Skip to content

Instantly share code, notes, and snippets.

@ZXEducation
Created December 5, 2023 02:46
Show Gist options
  • Save ZXEducation/7b41fe394780a8c23a5c1b7053bd4e30 to your computer and use it in GitHub Desktop.
Save ZXEducation/7b41fe394780a8c23a5c1b7053bd4e30 to your computer and use it in GitHub Desktop.
15分钟学会css动画-text-animation代码
<!DOCTYPE html>
<html
lang="zh-CN"
class="h-full"
>
<head>
<meta charset="UTF-8" />
<meta
name="viewport"
content="width=device-width, initial-scale=1.0"
/>
<script src="https://cdn.tailwindcss.com"></script>
<link
rel="stylesheet"
href="https://rsms.me/inter/inter.css"
/>
<style>
.text-animation {
background: linear-gradient(
-45deg,
#ee7752,
#e73c7e,
#23a6d5,
#23d5ab
);
color: transparent;
background-clip: text;
-webkit-background-clip: text;
background-size: 400% 400%;
animation: gradient 2.5s ease infinite alternate;
}
@keyframes gradient {
from {
background-position: 0% 50%;
}
to {
background-position: 100% 50%;
}
}
</style>
</head>
<body class="h-full bg-[#111827] flex items-center justify-center">
<div class="text-animation text-8xl font-extrabold">CSS</div>
</body>
</html>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment