Slide In Toast
CSS
Hard
2 views
Problem Description
Create a toast message that slides in from bottom.
Output Format
Print the HTML+CSS code in one block.
Constraints
Use keyframes translateY and opacity.
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 toastIn { from { transform: translateY(16px); opacity: 0; } to { transform: translateY(0); opacity: 1; } }
.toast { position: fixed; left: 16px; right: 16px; bottom: 16px; max-width: 520px; margin: 0 auto; background: #111; color: #fff; padding: 12px 14px; border-radius: 14px; animation: toastIn 350ms ease; }
</style>
</head>
<body>
<div class='toast'>Saved on meetcode</div>
</body>
</html>
Solutions (0)
No solutions submitted yet. Be the first!
No comments yet. Start the discussion!