2013-08-02 53 views
0

的顏色,我真的很困惑......我有這樣的代碼:訪問鏈接的是改變懸停

a { 
    float: left; 
    padding: 5px 20px; 
    } 
a:link { 
    text-decoration: none; 
    color: #008B45; 
    } 
a:hover { 
    color: #00FF00; 
    font-weight: bold; 
    } 
a:visited { 
    color: #EE9A00; 
    } 

但鏈接後,我訪問了它根據所涉及的鏈接沒有了變化的顏色:懸停...爲什麼?

謝謝

回答

0

我完全不知道爲什麼,但我想這是因爲屬性:參觀最好:懸停。爲了使這項工作,你必須在顏色語句的末尾添加「!important」。像這樣:

a { 
    float: left; 
    padding: 5px 20px; 
    } 
a:link { 
    text-decoration: none; 
    color: #008B45; 
    } 
a:hover { 
    color: #00FF00 !important; 
    font-weight: bold; 
    } 
a:visited { 
    color: #EE9A00; 
    }