html - css中的链接顺序

标签 html css pseudo-class

<a> 的正确样式顺序是什么?元素(链接、已访问、悬停、事件)。通过提供不同的组合,如 LVHA、LAHV,所有这些都令人困惑。任何人都可以指定正确的顺序吗?

最佳答案

链接已访问悬停

引用自CSS specification :

a:link    { color: red }    /* unvisited links */
a:visited { color: blue }   /* visited links   */
a:hover   { color: yellow } /* user hovers     */
a:active  { color: lime }   /* active links    */

Note that the A:hover must be placed after the A:link and A:visited rules, since otherwise the cascading rules will hide the 'color' property of the A:hover rule. Similarly, because A:active is placed after A:hover, the active color (lime) will apply when the user both activates and hovers over the A element.

关于html - css中的链接顺序,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/1536810/

相关文章:

html - 选择一个部分中的第一篇文章

javascript - 作为 element.contains() 参数输入的有效属性是什么?

css - 列溢出主 div 元素

javascript - CSS - 如何做 : "ONE-TIME CSS EXPRESSION" in css?(例如 IE 的最大高度/最大宽度)

javascript - 继续 JavaScript "classes"- 枚举

html - 为什么 ul 列表中的 First-of-type 不起作用

javascript - 在切换类上的 mouseenter 上

html - 如何在周围的 div 标签边框使用图像来提供自定义边框外观?

javascript - 为什么我的 Javascript 内容在网页中不可见

CSS悬停在移动设备上