<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title>Document</title>
<style>
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;
}
}
</style>
</head>
<body>
<h2>TikTok</h2>
</body>
</html>
CSS实现TikTok文字抖动效果
最新推荐文章于 2024-09-10 22:55:28 发布