Css 闪烁效果_Css3 闪烁动画效果
Css 闪烁效果_Css3 闪烁动画效果
1. 方案1,:befor:after +animation
css
.block { width: 400px; height: 300px; padding: 50px; border: 1px solid red; /* background: #000735; */ } @keyframes twinkling { 0% { opacity: 0.2; filter: alpha(opacity=20); transform: scale(1); } 50% { opacity: 0.5; filter: alpha(opacity=50); transform: scale(1.12); } 100% { opacity: 0.2; filter: alpha(opacity=20); transform: scale(1); } } .circle { width: 100px; height: 100px; border-radius: 50%; background: #3a96e1; text-align: center; font-weight: bold; position: relative; line-height: 100px; z-index: 1; } .circle::before { background: inherit; content: ''; position: absolute; width: 100%; height: 100%; left: 0; top: 0; z-index: -2; border-radius: 50%; animation: twinkling 2.2s ease-in-out infinite; } .circle::after { background: inherit; content: ''; position: absolute; width: 110%; height: 110%; left: -5%; top: -5%; z-index: -1; border-radius: 50%; animation: twinkling 2.2s ease-in-out infinite; } .circle2 { margin-top: 50px; width: 80px; height: 80px; line-height: 80px; font-size: 12px; background: #d67c61; }
html
<div class="block"> <div class="circle">千乐微云</div> <div class="circle circle2">小程序开发</div> </div>
展示效果:
2.方案2
待完善
更多: