纯css3 animate属性制作文字发光模糊的动画效果代码。该特效通过简单的 CSS3属性来实现文字的模糊和发光动画效果。
使用方法:
1、head引入css文件
<style>
.text-effect{
color: #fff;
font-family: '微软雅黑';
font-size: 80px;
text-transform: uppercase;
text-align: center;
letter-spacing: 8px;
margin: 30px auto 0;
animation: 4s animate infinite linear;
}
@keyframes animate{
0%{ text-shadow: 0 0 0 white; }
40%{
color: rgba(255,255,255,0);
text-shadow: 0 0 30px white;
}
70%{
color: rgba(255,255,255,0.4);
text-shadow: 0 0 10px white;
}
90%{
color: rgba(255,255,255,0.6);
text-shadow: 0 0 30px white;
}
100%{ text-shadow: 0 0 40px rgba(255,255,255,0); }
}
@media only screen and (max-width: 990px){
.text-effect{ font-size: 80px; }
}
@media only screen and (max-width: 767px){
.text-effect{ font-size: 40px; }
}
@media only screen and (max-width: 479px){
.text-effect{ font-size: 30px; }
}
@media only screen and (max-width: 359px){
.text-effect{ font-size: 25px; }
}
</style>
2、body引入HTML代码
<div class="text-effect">
<span>模糊文本</span>
</div>