Grid Align Items Start
CSS
Medium
2 views
Problem Description
Align grid items to the start using align-items: start.
Output Format
Print the HTML+CSS code in one block.
Constraints
Use a grid container with items of different heights.
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; align-items: start; }
.card { border: 1px solid #eee; border-radius: 12px; padding: 12px; }
</style>
</head>
<body>
<div class='grid'>
<div class='card'>Short</div>
<div class='card'>Longer content<br>line<br>line</div>
</div>
</body>
</html>
Solutions (0)
No solutions submitted yet. Be the first!
No comments yet. Start the discussion!