本篇文章小编给大家分享一下CSS实现TikTok文字抖动效果代码示例,文章代码介绍的很详细,小编觉得挺不错的,现在分享给大家供大家参考,有需要的小伙伴们可以来看看。
效果图如下:
附上代码
css;">body {
margin: 0;
padding: 0;
display: flex;
justify-content: center;
align-items: center;
min-height: 100vh;
background: #000;
}
h2 {
color: #fff;
font-family: sans-serif;
font-size: 4em;
animation: animate 0.5s linear infinite;
}
@keyframes animate {
0%, 100% {
text-shadow: -1.5px -1.5px 0 #0ff, 1.5px 1.5px 0 #f00;
}
25% {
text-shadow: 1.5px 1.5px 0 #0ff, -1.5px -1.5px 0 #f00;
}
50% {
text-shadow: 1.5px -1.5px 0 #0ff, 1.5px -1.5px 0 #f00;
}
75% {
text-shadow: -1.5px 1.5px 0 #0ff, -1.5px 1.5px 0 #f00;
}
}