关于定义a:visited后a:hover不起作用

在CSS中,定义了被访问过的链接的颜色(a:visited),结果当链接被访问过后,该链接的颜色不再改变,即定义鼠标在超级链接上的颜色(a:hover)不起作用了。我找到这里

锚点伪类 Anchor Pseudo-classes
A link that is active, visited, unvisited, or when you mouse over a link can all be displayed in different ways in a CSS-supporting browser:
当一个连接处于 活动,被访问,未访问或是当你鼠标移动到上面的时候都可以给它以不同的方式来表现,前提是浏览器支持CSS:
a:link {color: #FF0000} /* unvisited link */
a:visited {color: #00FF00} /* visited link */
a:hover {color: #FF00FF} /* mouse over link */
a:active {color: #0000FF} /* selected link */

Note: a:hover MUST come after a:link and a:visited in the CSS definition in order to be effective!!
注意 a:hover 必须在a:link和 a:visited后出现,要有顺序才能正常显示效果!

Note: a:active MUST come after a:hover in the CSS definition in order to be effective!!
注意: CSS中a:active必须出现在a:hover定义后才能有效果!

无意之间发现的问题,对 css 还是缺乏了解。

Tags: a:hover, a:visited, css

相关日志

If you enjoyed this post, please consider to leave a comment or subscribe to the feed and get future articles delivered to your feed reader.

Comments

不错的Wordpress!

发表评论

(必填)

(必填)


*
To prove you're a person (not a spam script), type the security word shown in the picture. Click on the picture to hear an audio file of the word.
Click to hear an audio file of the anti-spam word

Comment moderation is enabled. Your comment may take some time to appear.