• CSS3按钮效果


    来自codepen,http://codepen.io/PalashSharma20/pen/YWBAgN

    知识点:屏幕居中、transform、transition、transition-delay

    最重要的是idea

    <!DOCTYPE html>
    <html>
    <head>
        <meta charset="UTF-8">
        <title></title>
        <style>
            * { margin: 0; padding: 0; }
            body,
            html { height: 100%; min-height: 100%; }
            body { font-family: sans-serif; }
            .button { height: 200px; width: 400px; position: relative; top: 50%; left: 50%; transform: translateY(-50%) translateX(-50%); display: table; cursor: pointer; background: #252525; transition: 0.333333333333333s all ease-in; color: #ff4c4c; }
                .button .border { background: #ff4c4c; position: absolute; transition: 1s all linear; }
                    .button .border.o { height: 5px; width: 0; bottom: 0; left: 0; transition-delay: 1s; }
                    .button .border.tw { bottom: 0; right: 0; width: 5px; height: 0; }
                    .button .border.th { top: 0; right: 0; width: 0; height: 5px; transition-delay: 1s; }
                    .button .border.f { top: 0; left: 0; width: 5px; height: 0; }
                .button:hover { background: #ff4c4c; color: #252525; transition-delay: 2s; }
                    .button:hover .o,
                    .button:hover .th { width: 100%; }
                    .button:hover .tw,
                    .button:hover .f { height: 100%; }
                .button span { display: table-cell; vertical-align: middle; font-size: 40px; text-align: center; letter-spacing: 13px; text-transform: uppercase; font-weight: 100; }
        </style>
    </head>
    <body>
        <div class="button">
            <span>hover me</span>
            <div class="border o"></div>
            <div class="border tw"></div>
            <div class="border th"></div>
            <div class="border f"></div>
        </div>
    </body>
    </html>
  • 相关阅读:
    10w行级别数据的Excel导入优化记录
    迷失的人
    spring切面表达式详解
    json-path(json查找与操作)
    sprongboot yml文件语法
    消息队列面试突击系列--消息经典问题解决
    消息队列面试突击系列--消息产品对比
    mysql系列--sql实现原理
    mysql系列--锁和MVCC
    mysql系列--索引
  • 原文地址:https://www.cnblogs.com/talentzemin/p/5784090.html
Copyright © 2020-2023  润新知