这个button有点意思-css(4)

作者: EIUNG | 来源:发表于2017-07-17 08:09 被阅读0次
主要知识点:

transition
box-shadow

利用时间差完成描边的过程,样式可能有点丑,shadow不是重点…主要是学习用法

效果图片
btn.png
html文件
 <div class="a-box">
        <a href="">button</a>
 </div>  
css文件
   .a-box{
        text-align:center;
    }
    a{
        display: inline-block;
        margin: 10px 0;
        padding: 25px 50px;
        font-size: 20px;
        line-height: 0;
        color: #666;
        text-transform: uppercase;
        letter-spacing: 1px;
        text-decoration: none;
        font-weight: 700;
        transition: box-shadow ease-in 1s;
        box-shadow: 0 3px 3px -3px #ccc,0 2px 2px -2px rgba(255,255,255,.6),0 1px 1px -1px rgba(255,255,255,.8);
        overflow: hidden;
        position: relative;
        cursor: pointer;

    }
    a:before, a:after{
        box-sizing: border-box;
        border: 1px solid transparent;
        width: 0;
        height: 0;
        content: '';
        display: block;
        position: absolute;
    }
    a:after{
         bottom: 0;
         left: 0;
         -webkit-transition: border-color 0s ease-in .8s,height .2s ease-in .6s,width .2s ease-in .4s;
         transition: border-color 0s ease-in .8s,height .2s ease-in .6s,width .2s ease-in .4s;
     }
    a:before{
         top: 0;
         right: 0;
         -webkit-transition: border-color 0s ease-in .4s,height .2s ease-in .2s,width .2s ease-in;
         transition: border-color 0s ease-in .4s,height .2s ease-in .2s,width .2s ease-in;
     }
    a:hover{
        color: #638aba;
        box-shadow: 0 3px 3px  #ccc,0 2px 2px  rgba(255,255,255,.6),0 1px 1px rgba(255,255,255,.8);
    }
    a:hover:after{
         width: 100%;
         height: 100%;
         border-top-color: #638aba;
         border-left-color: #638aba;
         -webkit-transition: height .3s ease-out,width .3s ease-out .3s;
         transition: height .3s ease-out,width .3s ease-out .3s;
     }
    a:hover:before{
         width: 100%;
         height: 100%;
         border-bottom-color: #638aba;
         border-right-color: #638aba;
         -webkit-transition: border-color 0s ease-out .6s,height .3s ease-out .6s,width .3s ease-out .9s;
         transition: border-color 0s ease-out .6s,height .3s ease-out .6s,width .3s ease-out .9s;
     }

demo 请在chrome下预览(未写兼容性)

相关文章

  • 这个button有点意思-css(4)

    主要知识点: transitionbox-shadow 利用时间差完成描边的过程,样式可能有点丑,shadow不是...

  • 这个有点意思

    用你最喜欢的食物(最好是零食,水果蔬菜神马的也行)加上你最爱的动物,组成一个超级厉害的词呢,试一试吧(ง ˙o˙)ว

  • 这个有点意思

    如果26个英文字母 A B C D E F G H I J K L M N O P Q R S T U V W X...

  • 这个公司有点意思

    是的,我辞职了,而且是在没有落实好下一份工作的情况下,从前前后后效力了10年的公司出来。更关键的是已经35岁“高龄...

  • 这个冬天有点意思

    意兴阑珊 几片彩叶挂在树枝 水鸭们换了个名字 在云端飞舞变换方式 雨在偶尔的夜里格外有兴致 白天却懒得要死 阳光一...

  • 这个骗局有点意思

    推荐股票。 1.只推荐一支股票 2.有1000个目标群体,随机分AB两组,每组500人。 3.给A组预言涨,给B组...

  • 这个夏天有点意思

    永远不顺从,永远不认命。活得有意思

  • 这个世界有点意思

    我一直以为我懂了足够多的人情世故,也足以应付社会的刁难。可是我还是低估了它的莫测,一度让我猝不及防。 以...

  • 这个游戏有点意思

    今天参加了【创富研习社组织】的第三期现金流游戏 直接进入主题咯 奉上三个问题 1、游戏中印象最深的一笔投资是? 第...

  • 这个世界,有点意思

    ——安仁读书会第十八次活动预告 十四岁的少女苏菲看见镜子里的自己疯狂地眨眼,于是她走进了哲学的世界。笛卡尔说:“C...

网友评论

    本文标题:这个button有点意思-css(4)

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