Color Cycling Text
CSS
Medium
2 views
Problem Description
Animate a word to change color slowly.
Output Format
Print the HTML+CSS code in one block.
Constraints
Use keyframes to change color.
Official Solution
<!doctype html>
<html lang='en'>
<head>
<meta charset='utf-8'>
<meta name='viewport' content='width=device-width, initial-scale=1'>
<title>meetcode</title>
<style>
@keyframes hue { 0% { color: #0b5; } 50% { color: #0a58ca; } 100% { color: #0b5; } }
.word { font-weight: 700; font-family: system-ui, Arial, sans-serif; animation: hue 2.2s ease-in-out infinite; }
</style>
</head>
<body>
<div class='word'>meetcode</div>
</body>
</html>
Solutions (0)
No solutions submitted yet. Be the first!
No comments yet. Start the discussion!