
大家经常使用如下的方式设置链接的css样式:
a:link {
color: #2D8002;
text-decoration: underline;
}
a:hover {
color: #FF0000;
text-decoration: none;
}
a:visited {
color: #003300;
text-decoration: underline;
}
可有的时候命名设置好了hover样式,对于已经访问过的链接,当鼠标移到链接上时,结果却仍然显示的是visited的样式,怎么改怎么都这样,一次偶然的机会让我发现了问题的关键所在。。。(真啰嗦!!!)
原来css样式的各个设置也是有顺序的,上边的例子就可以正常看到访问过的链接效果,而下边的例子就不可以,这样大家就明白了吧:
a:link {
color: #2D8002;
text-decoration: underline;
}
a:visited {
color: #003300;
text-decoration: underline;
}
a:hover {
color: #FF0000;
text-decoration: none;
}
Trackback: http://tb.blog.csdn.net/TrackBack.aspx?PostId=580402