html 边框四周闪光的效果,纯css 边框闪烁效果

代码如下:

#ho-shan{

width: 100%;

height: 100%;

position: relative;

outline: none;

background-color: #dd524d;

border-radius: 5px;

transform-origin: 0 0;

opacity: .7;

border: none;

}

#ho-shan::after {

content: "";

-webkit-border-radius: 100%;

border-radius: 5px;

height: 100%;

width: 90%;

position: absolute;

box-shadow: 0 0 5px 6px #dd524d; //带阴影的边框,可以换成背景

animation: pulsate 1s ease-out;

animation-iteration-count: infinite;

animation-delay: 1.1s;

top: 0;

left: 5%;

}

@keyframes pulsate {

0% {

transform: scale(0.1, 0.1);

opacity: 0;

filter: alpha(opacity=0);

}

50% {

opacity: 1;

filter: none;

}

100% {

transform: scale(1.2, 1.2);

opacity: 0;

filter: alpha(opacity=0);

}

}

已测无误。css根据自己的项目设置的,个别参数自己调整。

效果如下(在线咨询):

9607b0798549707d57779431911117fa.png

再来个html新的:

CSS边框闪烁

div{

position: absolute;

}

span{

display:block;

width: 6.25rem;

height: 6.25rem;

cursor: pointer;

padding: 1rem;

text-align: center;

background: #eb9b41;

color: #fff;

border-radius: 100%;

z-index: 999;

-webkit-animation-fill-mode:both;

animation-fill-mode:both;

line-height: 6.25rem;

}

div:after{

border-radius:100%;

background:#fcc79d;

content:"";

bottom:0;

left:0;

right:0;

top:0;

position:absolute;

-webkit-animation:div 1.5s ease infinite;

animation:div 1.5s ease infinite;

-webkit-animation-fill-mode:both;

animation-fill-mode:both;

z-index: -99;

}

@-webkit-keyframes div{

0%{

-webkit-transform:scale(1.2);

transform:scale(1.2);

opacity:1

}

50%{

-webkit-transform:scale(1.4);

transform:scale(1.4);

opacity:.5

}

to{

-webkit-transform:scale(1.1);

transform:scale(1.1);

opacity:1

}

}

@keyframes div{

0%{

-webkit-transform:scale(1.2);

transform:scale(1.2);

opacity:1

}

50%{

-webkit-transform:scale(1.4);

transform:scale(1.4);

opacity:.5

}

to{

-webkit-transform:scale(1.2);

transform:scale(1.2);

opacity:1

}

}

CSS边框闪烁

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

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

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

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值