<style>
.navbar-brand {
text-align: center;
background-image: -webkit-linear-gradient(left, #2d8cf0, #fff 25%, #00bdff 50%, #fff 75%, #2d8cf0);
-webkit-text-fill-color: transparent;
-webkit-background-clip: text;
-webkit-background-size: 200% 100%;
-webkit-animation: masked-animation 2s infinite linear;
padding: 15px 15px;
font-size: 18px;
line-height: 20px;
color: #9d9d9d;
}
@-webkit-keyframes masked-animation {
0% {
background-position: 0 0;
}
100% {
background-position: -100% 0;
}
}
</style>
<div style="display: inline-block;padding: 10px 20px;background-color: #999;">
<span class="navbar-brand">文字效果</span>
</div>
演示