Grid Column Span
CSS
Medium
3 views
Problem Description
Make one grid item span across two columns.
Output Format
Print the HTML+CSS code in one block.
Constraints
Use grid-column: 1 / -1 for the wide item.
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>
.grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.item { border: 1px solid #eee; border-radius: 12px; padding: 12px; }
.wide { grid-column: 1 / -1; background: #eafaf1; }
</style>
</head>
<body>
<div class='grid'>
<div class='item wide'>meetcode featured topic</div>
<div class='item'>HTML</div>
<div class='item'>CSS</div>
</div>
</body>
</html>
Solutions (0)
No solutions submitted yet. Be the first!
No comments yet. Start the discussion!