|
|

楼主 |
发表于 2022-3-16 11:44
|
显示全部楼层
本帖最后由 马黑黑 于 2022-3-16 12:50 编辑
215楼代码:
<style>
.txtBg {
font-size: 4rem;
color: transparent;
width: 500px;
height: 100px;
line-height: 100px;
text-align: center;
background-image: linear-gradient(90deg, green, olive, transparent, tomato, green);
background-size: 500px 100px;
background-position: 500px 0;
border: 1px solid;
background-clip: text;
-webkit-background-clip: text;
animation: chgc 2s linear infinite;
}
@keyframes chgc {
from { background-position: -500px 0; }
to { background-position: 0 0; }
}
</style>
<div class="txtBg">动态变色文本</div>
|
|