自定义A标签下划线动画效果

 4年前     276  

文章目录

    效果图演示

    Lorem ipsum dolor sit amet ... beatae, quo iure ... consequatur.

     

    HTML代码

    <p>Lorem ipsum dolor <a class="fancy-link" href="#">sit amet ... beatae</a>, quo iure ... consequatur.</p>

    CSS样式代码

    .fancy-link {
       text-decoration: none;
       background-image: linear-gradient(red, red);
       background-repeat: no-repeat;
       background-position: bottom left;
       background-size: 0 3px;
       transition: background-size 500ms ease-in-out;
    }
    .fancy-link:hover {
       background-size: 100% 3px;
    }
    a:hover {
       color:red;
    }

    【腾讯云】2核2G4M云服务器新老同享99元/年,续费同价
    版权声明:ADMIN 发表于 4年前,共 689 字。
    转载请注明:自定义A标签下划线动画效果 | 奎利