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

2007年6月5日 | 分类: WebDesign | 标签: , ,

转载时请标明文章原始出处和作者信息, 作者: lostsnow.
http://www.lsproc.com/blog/anchor_pseudo_classes/

在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 还是缺乏了解。

-- EOF --

  1. 2008年2月5日22:54

    不错的Wordpress!

  2. 2008年8月4日12:38

    不知道为什么在使用table的时候.a:hover竟然不起作用.难道一定要加上全部的伪类吗?

  3. 2008年8月4日13:00

    @胖乎乎的坛子
    如何不起作用? 你是要让td 有hover效果?