link order in css

前端 未结 3 2067
爱一瞬间的悲伤
爱一瞬间的悲伤 2020-12-31 19:04
3条回答
  •  臣服心动
    2020-12-31 20:03

    Link Visited Hover Active

    To quote from the 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.

提交回复
热议问题