Min and Max Width
CSS
Medium
3 views
Problem Description
Create a box that never goes below 220px and never above 420px.
Output Format
Print the HTML+CSS code in one block.
Constraints
Use min-width and max-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>
.box { min-width: 220px; max-width: 420px; width: 70%; border: 2px solid #0b5; padding: 12px; }
</style>
</head>
<body>
<div class='box'>Resize the page and this box stays in range.</div>
</body>
</html>
Solutions (0)
No solutions submitted yet. Be the first!
No comments yet. Start the discussion!