Box Sizing Fix
CSS
Medium
2 views
Problem Description
Make two boxes same visual width by using border-box.
Output Format
Print the HTML+CSS code in one block.
Constraints
Use box-sizing: border-box on both boxes.
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>
.row { display: flex; gap: 12px; }
.box { width: 220px; padding: 16px; border: 6px solid #0b5; box-sizing: border-box; }
.box.gray { border-color: #999; }
</style>
</head>
<body>
<div class='row'>
<div class='box'>meetcode</div>
<div class='box gray'>practice</div>
</div>
</body>
</html>
Solutions (0)
No solutions submitted yet. Be the first!
No comments yet. Start the discussion!