Align Grid Content

Align Grid Content

Hard CSS Grid Layout 19 views
Explanation Complexity

Problem Statement

Make a grid with extra height and align content to top using align-content.

Input Format

No input.

Output Format

Print the HTML+CSS code in one block.

Constraints

Use align-content: start on the grid container.

Input / Output Format

Input Format
No input.
Output Format
Print the HTML+CSS code in one block.
Constraints
Use align-content: start on the grid container.

Examples

Input:
Output:
(HTML+CSS code)

Example Solution (Public)

CSS
<!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 { height: 380px; border: 1px dashed #bbb; display: grid; grid-template-columns: 1fr 1fr; gap: 12px; align-content: start; padding: 12px; }
    .item { border: 1px solid #eee; border-radius: 12px; padding: 12px; }
  </style>
</head>
<body>
  <div class='grid'>
    <div class='item'>meetcode</div>
    <div class='item'>practice</div>
    <div class='item'>notes</div>
  </div>
</body>
</html>

Official Solution Code

<!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 { height: 380px; border: 1px dashed #bbb; display: grid; grid-template-columns: 1fr 1fr; gap: 12px; align-content: start; padding: 12px; }
    .item { border: 1px solid #eee; border-radius: 12px; padding: 12px; }
  </style>
</head>
<body>
  <div class='grid'>
    <div class='item'>meetcode</div>
    <div class='item'>practice</div>
    <div class='item'>notes</div>
  </div>
</body>
</html>
Please login to submit solutions.
Editor
Output

                                        
Please login to submit solutions.