2013-03-17 135 views
-1
.button1{ 


    background: #E68A00 url(wooden.jpg) repeat-x; 
    border: 2px solid #eee; 
    height: 28px; 
    width: 115px; 
    margin: 50px 0 0 50px; 
    padding: 0 0 0 7px; 
    overflow: hidden; 
    display: block; 
    text-decoration:none; 
    font-family: 'Sacramento', cursive; 
    color : white; 
    font-size: 30px; 




    /*Rounded Corners*/ 
-webkit-border-radius: 15px; 
-moz-border-radius: 15px; 
border-radius: 15px; 

/*Gradient*/ 
background-image: -webkit-linear-gradient(top, rgba(0, 0, 0, 0), rgba(0, 0, 0, 0.2)); 
background-image: -moz-linear-gradient(top, rgba(0, 0, 0, 0), rgba(0, 0, 0, 0.2)); 
background-image: -o-linear-gradient(top, rgba(0, 0, 0, 0), rgba(0, 0, 0, 0.2)); 
background-image: -ms-linear-gradient(top, rgba(0, 0, 0, 0), rgba(0, 0, 0, 0.2)); 
background-image: linear-gradient(top, rgba(0, 0, 0, 0), rgba(0, 0, 0, 0.2)); 

/*Transition*/ 
-webkit-transition: All 0.5s ease; 
-moz-transition: All 0.5s ease; 
-o-transition: All 0.5s ease; 
-ms-transition: All 0.5s ease; 
transition: All 0.5s ease; 


} 

pg.button1{ 
position:absolute; 
right:0px; 
top:100px; 

} 

pg:hover { 
    width: 200px; 
} 






<pg <a class = "button1" href="http://www.google.com">Small $14 </a> </pg>## Heading ## 

上面的標籤是一個鏈接,直到我引入了標籤pg,這意味着將鏈接放置在屏幕上。原因是,我仍然想與其他對象一起使用該類!所以我不必重複我的代碼!我創建了像p1 p2 p3 p4這樣的標籤以用於同一個類 它實際上可以定位它,但它不再是鏈接!這是爲什麼 ?我又如何得到這個工作?另一個標籤內的標籤html

+1

你錯過了'>'在初始' '標籤。這就是說,製作新標籤是一個非常可疑的做法。 – Pointy 2013-03-17 18:47:25

回答

1

而不是發明新的標籤,只是使用多個類。在這種情況下,這取決於你在做什麼實際上試圖做的,你可以這樣做:

<a class="button1 pg" href="...">Small $14</a> 

或者這樣:

<div class="pg"><a class="button1" href="...">Small $14</a></div> 
+0

謝謝,實際上修復了鏈接問題,但位置已經回到了左上角,關於如何解決這個問題的任何想法? – user2125086 2013-03-17 18:54:05

+0

你可能需要一個包含元素與'位置:相對' – 2013-03-17 18:55:21

+0

我試過,仍然沒有工作 – user2125086 2013-03-17 18:57:44

相關問題