Loading Dots
CSS
Hard
2 views
Problem Description
Create three dots that move up and down like a loader.
Output Format
Print the HTML+CSS code in one block.
Constraints
Use keyframes and different animation-delay values.
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 jump { 0%, 100% { transform: translateY(0); opacity: 0.6; } 50% { transform: translateY(-6px); opacity: 1; } }
.dot { width: 10px; height: 10px; border-radius: 50%; background: #0b5; display: inline-block; animation: jump 700ms ease-in-out infinite; }
.dot:nth-child(2) { animation-delay: 120ms; }
.dot:nth-child(3) { animation-delay: 240ms; }
</style>
</head>
<body>
<div>
<span class='dot'></span>
<span class='dot'></span>
<span class='dot'></span>
<span>Loading meetcode</span>
</div>
</body>
</html>
Solutions (0)
No solutions submitted yet. Be the first!
No comments yet. Start the discussion!