css3 呼吸动画按钮

 

<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title></title>
<style type="text/css">
html,body{
height: 100%;
width: 100%;
padding: 0;
margin: 0;
}
.circle{
width: 160px;
height: 160px;
cursor:pointer;
position: relative;
border-radius: 50%;
background-color: rgba(105,217,216,.1);

/*倒影*/
-webkit-box-reflect: below 0 -webkit-linear-gradient(top,rgba(250,250,250,0),rgba(250,250,250,.1) 30%,rgba(250,250,250,0.5));
box-reflect: below 0 -webkit-linear-gradient(top,rgba(250,250,250,0),rgba(250,250,250,.1) 30%,rgba(250,250,250,0.5));
}



.mybtn{
animation-name: mybtn;
animation-duration: 1s;
animation-timing-function: linear;
animation-iteration-count: infinite;
animation-direction: alternate;
animation-play-state: running;
/*Firefox: */
-moz-animation-name: mybtn;
-moz-animation-duration: 1s;
-moz-animation-timing-function: linear;
-moz-animation-iteration-count: infinite;
-moz-animation-direction: alternate;
-moz-animation-play-state: running;
/*ie: */
-ms-animation-name: mybtn;
-ms-animation-duration: 1s;
-ms-animation-timing-function: linear;
-ms-animation-iteration-count: infinite;
-ms-animation-direction: alternate;
-ms-animation-play-state: running;
/* Safari 和 Chrome: */
-webkit-animation-name: mybtn;
-webkit-animation-duration: 1s;
-webkit-animation-timing-function: linear;
-webkit-animation-iteration-count: infinite;
-webkit-animation-direction: alternate;
-webkit-animation-play-state: running;
/* Opera: */
-o-animation-name: mybtn;
-o-animation-duration: 1s;
-o-animation-timing-function: linear;
-o-animation-iteration-count: infinite;
-o-animation-direction: alternate;
-o-animation-play-state: running;
}

 .circle:before,
.circle:after{
position: absolute;
border-radius: 50%;
}
.circle:before{
content: "";
width: 90%;
height: 90%;
margin:5%;
background-color: rgba(105,217,216,.3);
}
.circle:after{
width: 80%;
height: 80%;
margin:10%;
content: "按钮";
color: #fff;
font-family: '微软雅黑';
vertical-align: middle;
text-align: center;

/*镜相渐变背景*/
background-image: -webkit-radial-gradient(ellipse at left top, rgb(140,230,250),rgb(50,140,180));
background-image: -moz-radial-gradient(ellipse at left top, rgb(140,230,250),rgb(50,140,180));
background-image: -ms-radial-gradient(ellipse at left top, rgb(140,230,250),rgb(50,140,180));
background-image: -o-radial-gradient(ellipse at left top, rgb(140,230,250),rgb(50,140,180));
background-image: radial-gradient(ellipse at left top, rgb(140,230,250),rgb(50,140,180));
}

.circle:after,
.middle{
/*文字垂直居中*/
display: -webkit-box;
-webkit-box-orient: horizontal;
-webkit-box-pack: center;
-webkit-box-align: center;
display: -moz-box;
-moz-box-orient: horizontal;
-moz-box-pack: center;
-moz-box-align: center;
display: -o-box;
-o-box-orient: horizontal;
-o-box-pack: center;
-o-box-align: center;
display: -ms-box;
-ms-box-orient: horizontal;
-ms-box-pack: center;
-ms-box-align: center;
display: box;
box-orient: horizontal;
box-pack: center;
box-align: center;
}

@keyframes mybtn{
from {background-color: rgba(105,217,216,.1);}
to {background-color: rgba(105,217,216,.5);}
}

@-moz-keyframes mybtn{
from {background-color: rgba(105,217,216,.1);}
to {background-color: rgba(105,217,216,.5);}
}

@-webkit-keyframes mybtn{
from {background-color: rgba(105,217,216,.1);}
to {background-color: rgba(105,217,216,.5);}
}

@-o-keyframes mybtn{
from {background-color: rgba(105,217,216,.1);}
to {background-color: rgba(105,217,216,.5);}
}
</style>
</head>
<body class="middle">

<div class="circle mybtn"></div>
</body>
</html>

 

转载于:https://www.cnblogs.com/jsoncode/p/4126527.html

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值