美文网首页我爱编程
利用css实现悬停的一下效果

利用css实现悬停的一下效果

作者: 抠脚大汉梁天睿 | 来源:发表于2018-05-23 10:41 被阅读0次
    bV9mBs.gif bV9mwZ.gif
    .div1 {
        font-size: 20px;
        position: relative;
        width: 200px;
        height: 60px;
        line-height: 60px;
        margin: 20px;
    }
    .div1::before {
        content: "";
        position: absolute;
        left: 0;
        bottom: 0;
        width: 200px;
        background: aquamarine;
        height: 2px;
        transition: transform .5s;
        transform: scaleX(0);
      }
    .div1:hover::before {
        transform: scaleX(1);
      }
    

    实现的效果都是用css实现的
    主要用到的就是transform-origin
    仓库中还有好多的效果
    仓库地址

    相关文章

      网友评论

        本文标题:利用css实现悬停的一下效果

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