伪类顺序

<!DOCTYPE html>
<html>
    <head>
        <meta charset="utf-8">
        <title></title>
        <style type="text/css">
            /*
              设计a的伪类4种
              :link       }
              :visited    } 不能写在hover active下
              :hover 不能写在active下方
              :active
              四种选择器优先级一致
            
            
            */
            a:link{
                color: yellowgreen;
            }
            a:visited{
                color: red;
            }
            a:hover{
                color: blue;
            }
            a:active{
                color: brown;
            }
        </style>
    </head>
    <body>
        <a href="http://www.baidu.com">访问过</a><br /><br />
        <a href="http://www.baidu1122.com">未访问</a>
    </body>
</html>

link visited两个伪类可以相互调换位置写,但不能写在hover   active下,hover不能写在active下

posted @ 2021-06-30 15:00  2237774566  阅读(45)  评论(0)    收藏  举报