zoukankan      html  css  js  c++  java
  • 使用CSS3对链接颜色与下划线进行优化

    效果:

      

    代码:

    <!DOCTYPE html>
    <html lang="en">
    <head>
        <meta charset="UTF-8">
        <title>Test</title>
        <style>
            *{margin:0px;padding:0px;list-style:none;}
            body{font-family:'Microsoft Yahei';}
            ul{margin-top:10px;}
            a,a:hover{text-decoration:none;}
            a{display:block;width:100px;padding-bottom:15px;
                height:20px;line-height:20px;text-align: center;
                font-size:14px;color:#000;transition:all .3s linear;
                position:relative;
            }
            a:hover{color:#f00;}
            a:after{
                content:'';
                display:block;
                width: 100%;
                overflow:hidden;
                height:19px;
                line-height:0px;
                border-bottom:1px solid red;
                position:absolute;
                left:0px;
                top:0px;
                transition:all .3s linear;
                transform:scaleX(0);
            }
            a:hover:after{
                transform:scaleX(.9);
            }
        </style>
    </head>
    <body>
        <ul>
            <li><a href="javascript:;">测试内容1</a></li>
            <li><a href="javascript:;">测试内容2</a></li>
            <li><a href="javascript:;">测试内容3</a></li>
            <li><a href="javascript:;">测试内容4</a></li>
            <li><a href="javascript:;">测试内容5</a></li>
        </ul>
    </body>
    </html>
  • 相关阅读:
    获取设备型号
    笔记
    福大软工 · 最终作业
    福大软工 · 第十二次作业
    Beta 冲刺(7/7)
    Beta 冲刺(6/7)
    Beta 冲刺(5/7)
    Beta 冲刺(4/7)
    Beta 冲刺(3/7)
    Beta 冲刺(2/7)
  • 原文地址:https://www.cnblogs.com/HCJJ/p/4967764.html
Copyright © 2011-2022 走看看