Grid Center Single Column
CSS
Easy
3 views
Problem Description
Create a single column layout that is centered using max-width and margin.
Output Format
Print the HTML+CSS code in one block.
Constraints
Use max-width and margin auto.
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>
.wrap { max-width: 640px; margin: 0 auto; padding: 16px; }
.grid { display: grid; gap: 12px; }
.card { border: 1px solid #eee; border-radius: 14px; padding: 14px; }
</style>
</head>
<body>
<div class='wrap'>
<div class='grid'>
<div class='card'>meetcode: HTML</div>
<div class='card'>meetcode: CSS</div>
<div class='card'>meetcode: JS</div>
</div>
</div>
</body>
</html>
Solutions (0)
No solutions submitted yet. Be the first!
No comments yet. Start the discussion!