|
|

楼主 |
发表于 2022-3-14 12:55
|
显示全部楼层
纯CSS文本自动变色代码:
<style>
/* 文本层 */
.txtCeng {
margin: 10px auto 0;
width: 400px;
height: 200px;
line-height: 200px;
font-family: Arial, '微软雅黑';
font-size: 4em;
color: #eee;
text-align: center;
text-shadow: 1px 1px 1px #ffcc00, 2px 2px 2px #aaa;
background: rgba(255, 255, 255, .1);
animation: chgColor 5s ease-in-out infinite alternate;
}
/* 文本层变色 */
@keyframes chgColor {
0% { color: navy; }
20% { color: green; }
40% { color: red; }
60% { color: olive; }
80% { color: olive; }
100% { color: tomato; }
}
</style>
<div class="txtCeng">HELLO CSS!</div>
|
|