美文网首页
单一动感线条效果

单一动感线条效果

作者: 禾苗种树 | 来源:发表于2021-12-11 17:08 被阅读0次
    • 单一动感线条效果一


      单一动感线条.gif

      代码如下:

    <!DOCTYPE html>
    <html lang="en">
    <head>
        <meta charset="UTF-8">
        <meta http-equiv="X-UA-Compatible" content="IE=edge">
        <meta name="viewport" content="width=device-width, initial-scale=1.0">
        <title>Document</title>
        <script src="js/jquery-1.7.2.min.js"></script>
    
    </head>
    <style>
        .box{
            width: 1200px;
            margin: 0 auto;
            margin-top: 100px;
            background: #645832;
            padding: 5px;
        }
        .box a{
            text-decoration: none;
            display: block;
            height: 50px;
            width: 80px;
            color: burlywood;
            /* transition: color .25s ease-out,opacity .25s ease-out; */
          
        }
        .box a:after{
            margin-top: 3px;
            margin: 0 auto;
    
            /* 必写 */
            content:"";
            display: block;
            width: 90%;
            height: 1px;
            background-color: burlywood;
            transform-origin: right;
            transform: scaleX(0);
            transition: transform .8s cubic-bezier(.16,1,.3,1);
            /* 关键属性 */
        }
        .box a:hover:after{
            transform: scale(1);
            transform-origin: left;
            transition: transform .8s cubic-bezier(.16,1,.3,1);
            /* 贝塞尔曲线 */
    
        }
    </style>
    <body>
        <div class="box">
            <a href="">1-Decors</a>
            <a href="">2-Decors</a>
            <a href="">3-Decors</a>
            <a href="">4-Decors</a>
        </div>
    </body>
    </html>
    

    总结:
    使用伪类在a标签后添加内容“线条”,
    transform属性,
    transition属性
    贝塞尔曲线--->贝塞尔曲线属性值在线生成器

    相关文章

      网友评论

          本文标题:单一动感线条效果

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