奇怪的CSS行爲。 當我設置訪問顏色使用CSS(a.nav:懸停如下例),然後懸停不起作用,一旦鏈接被用戶訪問。但是,當我設置它的父元素的引用(.header a.nav:hover如下)它的作品。爲什麼?幫我理解奇怪的CSS行爲!
a.nav:visited{
color:yellow;
}
/*once the link is visited by user this rule not working*/
a.nav:hover{
color:red;
}
/*if we use this rule it works even after the link is visited*/
.header a.nav:hover{
color:red;
}
<div class="header">
<a class="nav" .. >test </a>
</div>
適用於我:http://jsfiddle.net/9S9h5/ – poke 2010-10-28 09:24:33