导航栏悬停动画效果

<style>
.c-btn--border-line {
    border: 1px solid #EDEDED;
    padding-left: 40px;
    margin-left: 10px;
    padding-right: 20px;
    margin-right: 10px;
    display: block;
    line-height: 40px;
    -webkit-transition: all 0.6s ease-in;
    -moz-transition: all 0.6s ease-in;
    -ms-transition: all 0.6s ease-in;
    -o-transition: all 0.6s ease-in;
    transition: all 0.6s ease-in;
    background: none;
    box-sizing: border-box;
    box-shadow: inset 0 0 0 0px transparent;
    text-decoration: none;
    position: relative;
    height: 100%;
}


.c-btn--border-line:after {
    content: '';
    display: block;
    position: absolute;
}
.c-btn--border-line:hover{
  border: 1px solid #367dff;
}
.c-btn--border-line:before {
    content: '';
    display: block;
    position: absolute;
}
.c-btn--border-line:after,.c-btn--border-line:before {
    box-sizing: border-box;
    border: 1px solid transparent;
    width: 0;
    height: 0;
}

.c-btn--border-line:after {
    top: 0;
    left: 0;
    -webkit-transition: border-color 0s ease-in 0.8s,width 0.2s ease-in 0.6s,height 0.2s ease-in 0.4s;
    transition: border-color 0s ease-in 0.8s,width 0.2s ease-in 0.6s,height 0.2s ease-in 0.4s;
}

.c-btn--border-line:before {
    bottom: 0;
    right: 0;
    -webkit-transition: border-color 0s ease-in 0.4s,width 0.2s ease-in 0.2s,height 0.2s ease-in;
    transition: border-color 0s ease-in 0.4s,width 0.2s ease-in 0.2s,height 0.2s ease-in;
}

.c-btn--border-line:hover:after,.c-btn--border-line:hover:before {
    width: 100%;
    height: 100%;
}

.c-btn--border-line:hover:after {
    border-top-color: #367dff;
    border-right-color: #367dff;
    -webkit-transition: width 0.2s ease-out,height 0.2s ease-out 0.2s;
    transition: width 0.2s ease-out,height 0.2s ease-out 0.2s;
}

.c-btn--border-line:hover:before {
    border-bottom-color: #367dff;
    border-left-color: #367dff;
    -webkit-transition: border-color 0s ease-out 0.4s,width 0.2s ease-out 0.4s,height 0.2s ease-out 0.6s;
    transition: border-color 0s ease-out 0.4s,width 0.2s ease-out 0.4s,height 0.2s ease-out 0.6s;
}
</style>

<body>
	<div class="c-btn--border-line">测试</div>
</body>
  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值