Mobile First Card Width
CSS
Medium
2 views
Problem Description
Write mobile-first CSS: card is full width, then fixed width on large screens.
Output Format
Print the HTML+CSS code in one block.
Constraints
Start with small screen styles, then add min-width media query.
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>
.card { width: 100%; border: 1px solid #eee; border-radius: 14px; padding: 14px; box-sizing: border-box; }
@media (min-width: 800px) { .card { width: 420px; } }
</style>
</head>
<body>
<div class='card'>meetcode card</div>
</body>
</html>
Solutions (0)
No solutions submitted yet. Be the first!
No comments yet. Start the discussion!