text-shadow keyframes 实现文字抖动
<style>
body {
margin: 0;
padding: 0;
display: flex;
justify-content: center;
align-items: center;
min-height: 100vh;
background: #000;
}
h2 {
color: yellow;
font-family: sans-serif;
font-size: 4em;
animation: animate 1s 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>jiujueismmp</h2>
</body>
本博客所有文章除特别声明外,均采用 CC BY-NC-SA 4.0 许可协议。转载请注明来自 jiujue!
评论