Pulse Badge
CSS
Medium
2 views
Problem Description
Make a small badge pulse using keyframes.
Output Format
Print the HTML+CSS code in one block.
Constraints
Use scale or shadow in an infinite animation.
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 pulse { 0% { transform: scale(1); } 50% { transform: scale(1.08); } 100% { transform: scale(1); } }
.badge { display: inline-block; background: #0b5; color: #fff; padding: 4px 10px; border-radius: 999px; font-size: 12px; animation: pulse 900ms ease-in-out infinite; }
</style>
</head>
<body>
<span class='badge'>NEW</span>
</body>
</html>
Solutions (0)
No solutions submitted yet. Be the first!
No comments yet. Start the discussion!