2014-02-20 40 views
0

http://jsfiddle.net/4UA82/1/輸入提交想改變懸停利用CSS

#subscribe-submit input[type="submit"] { 
    text-decoration: none !important; 
    color: #000000 !important; 
    font-size: 12px !important; 
    padding-top: 5px !important; 
    padding-right: 5px !important; 
    padding-bottom: 5px !important; 
    padding-left: 5px !important; 
    background-color: #24890d !important; 
} 
#subscribe-submit input[type="submit"]:visited { 
    text-decoration: none !important; 
    color: #000000 !important; 
} 
#subscribe-submit input[type="submit"]:hover { 
    font-size: 12px; 
    background-color: #2b2b2b; 
    color: #000000 !important; 
} 
#subscribe-submit input[type="submit"]:active { 
    font-size: 12px; 
    background-color: #2b2b2b; 
} 

我只是試圖讓這個按鈕懸停的背景顏色,但它是不工作的某些原因。

我可以讓它徘徊,如果我雖然刪除初始設置:

#subscribe-submit input[type="submit"] { 
    text-decoration: none !important; 
    color: #000000 !important; 
    font-size: 12px !important; 
    padding-top: 5px !important; 
    padding-right: 5px !important; 
    padding-bottom: 5px !important; 
    padding-left: 5px !important; 
    background-color: #24890d !important; 
} 

所以我不知道是怎麼回事。

謝謝!

回答

2

刪除!important標籤

#subscribe-submit input[type="submit"] { 
    background-color: #24890d; 
} 

對每個屬性使用!important需要表明,有在你構建你的CSS

+0

事實上,刪除所有'!重要'語句...你大量過度使用它們。 –

+0

謝謝!我使用這個按鈕css gernerator插件,它自動放置!重要標籤。我不認爲他們可能會導致問題 – Scientized

0

在#認購提交輸入[型方式的缺陷=」提交「]更改

background-color: #24890d!important; 

background-color: #24890d;