Progress Bar Animation
CSS
Hard
3 views
Problem Description
Animate a progress bar from 0% to 70%.
Output Format
Print the HTML+CSS code in one block.
Constraints
Use keyframes to animate width.
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 fill { from { width: 0; } to { width: 70%; } }
.track { width: 360px; height: 12px; background: #e5e7eb; border-radius: 999px; overflow: hidden; }
.bar { height: 100%; background: #0b5; width: 0; animation: fill 1.2s ease forwards; }
</style>
</head>
<body>
<div class='track'><div class='bar'></div></div>
</body>
</html>
Solutions (0)
No solutions submitted yet. Be the first!
No comments yet. Start the discussion!