Spinner Loader
CSS
Hard
2 views
Problem Description
Create a small CSS spinner (no images) for meetcode loading.
Output Format
Print the HTML+CSS code in one block.
Constraints
Use border trick and rotate 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 spin { to { transform: rotate(360deg); } }
.spinner { width: 34px; height: 34px; border-radius: 50%; border: 4px solid #e5e7eb; border-top-color: #0b5; animation: spin 800ms linear infinite; }
</style>
</head>
<body>
<div class='spinner' aria-label='Loading'></div>
</body>
</html>
Solutions (0)
No solutions submitted yet. Be the first!
No comments yet. Start the discussion!