zoukankan      html  css  js  c++  java
  • 利用css实现鼠标经过元素,下划线由中间向两边展开

    代码如下:

    <!DOCTYPE html>
    <html lang="en">
    <head>
    <meta charset="UTF-8">
    <title>鼠标移入下划线展开</title>
    <style type="text/css">
    #underline{
         200px;
        height: 50px;
        background: #ddd;
        margin: 20px;
        position: relative;
    }
    
    #underline:after{
        content: "";
         0;
        height: 1px;
        background: blue;
        position: absolute;
        top: 100%;
        left: 50%;
        transition: all .8s;
    }
    
    #underline:hover:after{
       left: 0%;
        100%;
    }
    </style>
    
    </head>
    
    <body>
    
        <div id="underline"></div>
    
    </body>
    
    </html> 


    参考文:https://blog.csdn.net/qq_31648761/article/details/72953434?locationNum=9&fps=1


    方法二:
    <a href=‘‘ class=‘ui-box bottom-inOutSpread‘>Audio Description</a>

    css:
    .ui-box {
    text-decoration:none;
    border:none;
    font-family:‘Roboto‘, sans-serif;
    font-size:14px;
    position:relative;
    vertical-align:baseline;
    padding:10px
    }
    .bottom-inOutSpread:before,.bottom-inOutSpread:after,.bottom-inOutSpread>.ui-border-element:before,.bottom-inOutSpread>.ui-border-element:after {
    content:‘‘;
    position:absolute
    }
    .bottom-inOutSpread:after {
    border-bottom:2px solid #333;
    left:51%;
    right:51%;
    bottom:0px;
    -webkit-transition-property:all;
    -moz-transition-property:all;
    -o-transition-property:all;
    transition-property:all;
    -webkit-transition-timing-function:cubic-bezier(0, 0.98, 0.51, 0.93);
    -moz-transition-timing-function:cubic-bezier(0, 0.98, 0.51, 0.93);
    -o-transition-timing-function:cubic-bezier(0, 0.98, 0.51, 0.93);
    transition-timing-function:cubic-bezier(0, 0.98, 0.51, 0.93);
    -webkit-transition-duration:200ms;
    -moz-transition-duration:200ms;
    -o-transition-duration:200ms;
    transition-duration:200ms;
    -webkit-transition-delay:0s;
    -moz-transition-delay:0s;
    -o-transition-delay:0s;
    transition-delay:0s
    }
    .bottom-inOutSpread:hover:after {
    left:0%;
    right:0%
    }
    .bottom-inOutSpread:not(:hover):after {
    -webkit-transition-delay:0s;
    -moz-transition-delay:0s;
    -o-transition-delay:0s;
    transition-delay:0s
    }
    原文:http://www.cnblogs.com/HONGYE1994/p/8012093.html
  • 相关阅读:
    Pycharm快捷键【mac版】
    程序解数独
    c++ map
    c++ vector 初始化二维数组
    二进制求和
    数组形式的加一
    坑题:最后一个单词的长度
    最大子序和:dp
    外观数列
    双指针消重复项
  • 原文地址:https://www.cnblogs.com/smuwgeg/p/9538030.html
Copyright © 2011-2022 走看看