发光文本
创建于 2024-12-03 /
32
字体:
[默认]
[大]
[更大]
了解如何使用 CSS 创建发光文本。
亲自试一试 »
如何创建发光文本
使用 text-shadow
属性创建霓虹灯效果,然后使用 animation
和 keyframes
添加重复发光效果:
实例
.glow {font-size: 80px;
color: #fff;
text-align: center;
-webkit-animation: glow 1s ease-in-out infinite alternate;
-moz-animation: glow 1s ease-in-out infinite alternate;
animation: glow 1s ease-in-out infinite alternate;
}
@-webkit-keyframes glow {
from {
text-shadow: 0 0 10px #fff, 0 0 20px #fff, 0 0 30px #e60073, 0 0 40px #e60073, 0 0 50px #e60073, 0 0 60px #e60073, 0 0 70px #e60073;
}
to {
text-shadow: 0 0 20px #fff, 0 0 30px #ff4da6, 0 0 40px #ff4da6, 0 0 50px #ff4da6, 0 0 60px #ff4da6, 0 0 70px #ff4da6, 0 0 80px #ff4da6;
}
}
亲自试一试 »
0 人点赞过