伪类

作者: 王小贱_ww | 来源:发表于2018-01-09 15:26 被阅读7次

    在CSS中,伪类用于向某些选择器添加特殊的效果。

    <!DOCTYPE html>
    <html lang="en">
    <head>
        <meta charset="UTF-8">
        <title>伪类</title>
        <style type="text/css">
            
          a:link{
                     color: red;
                     text-decoration: none;  
                 } 
    
         a:visited{
            color:pink;
         }
         a:hover{
            color: green;
            text-decoration: underline;
         }
         a:active{
            color: black
         }
        </style>
    </head>
    <body>
    
        <a href="https://www.jianshu.com/" target="_blank">简书</a>
        
    </body>
    </html>
    
    • 利用a:link{ }设置了超链接的颜色
    • 利用a:visited{ }设置超链接访问过后的样式
    • 利用a:hover{ }设置鼠标放到超链接上时的样式
    • 利用a:active{ }设置超链接被点击瞬间的样式

    相关文章

      网友评论

          本文标题:伪类

          本文链接:https://www.haomeiwen.com/subject/cqxgnxtx.html