美文网首页
CSS-伪类的样式

CSS-伪类的样式

作者: 测试探索 | 来源:发表于2022-06-04 09:55 被阅读0次

    一、介绍

    image.png
    image.png

    二、目录和代码

    index.html

    <!DOCTYPE html>
    <html lang="en">
    <head>
        <meta charset="UTF-8">
        <title>Document</title>
        <link rel="stylesheet" type="text/css" href="index.css">
    </head>
    <body>
        <p>http://www.baidu.com</p>
        <p class="p1">test</p>
        <a href="#">伪类</a>
        <label>用户名</label>
        <input type ="text">
    </body>
    </html>
    

    index.css

    a:link{
        color: red;
    }
    
    a:visited{
        color: green;
    }
    
    a:hover{
        color: yellow;
        font-size: 30px;
    }
    
    a:active{
        color: blue;
    }
    
    label:hover{
        color: red;
    }
    
    input:hover{
        background-color: red;
    }
    
    input:active{
        background-color: blue;
    }
    
    image.png

    相关文章

      网友评论

          本文标题:CSS-伪类的样式

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