Here’s what those extra rules do, step by step—building on the grid you already have:
- h1 styling
h1 {
font:
1em "typewriter",
monospace;
align-self: end;
}
- font: sets the heading to 1 em in size, first trying a
"typewriter" font, then falling back to any monospace.
- align-self: end: in a flex‐ or grid‐context this would push the
<h1> down to the bottom of its cell.
• In your current HTML, the <h1> sits outside the <form> grid, so it isn’t actually a grid item—this rule will be ignored unless you move the <h1> into your grid container (the form).
- #message spanning multiple rows
#message {
grid-row: 1 / 5;
}
-
grid-row: 1 / 5 tells the browser:
• Start at grid line 1 (top of row 1)
• End just before grid line 5 (bottom of row 4)
-
In plain English, #message now stretches all the way down column 1, covering rows 1, 2, 3 and 4.
-
The other items flow into the first available cells in column 2:
Grid before this rule (auto‐placed)
┌────────────┬────────────┐
│ #from │ #reply │ ← row 1 (10 em tall)
├────────────┼────────────┤
│ #message │ .button │ ← row 2 (1 em)
├────────────┼────────────┤
│ (empty) │ (empty) │ ← row 3 (1 em)
├────────────┼────────────┤
│ (empty) │ (empty) │ ← row 4 (1 em)
└────────────┴────────────┘
Grid after #message { grid-row: 1/5; }
┌────────────────┬────────────┐
│ #message │ #from │ ← row 1 (10 em)
├────────────────┼────────────┤
│ (covered by #message) │ #reply│ ← row 2 (1 em)
├────────────────┼────────────┤
│ (covered) │ .button │ ← row 3 (1 em)
├────────────────┼────────────┤
│ (covered) │ (empty) │ ← row 4 (1 em)
└────────────────┴────────────┘
- Turning labels + inputs into flex rows
#from,
#reply {
display: flex;
}
- Makes each of these containers a flexbox in row direction by default.
- Inside them, the
<label> and <input> sit side-by-side and can easily be aligned or spaced (e.g. you could add gap: .5em; or align-items: center;).
If you’re finding that your inputs or button are being squashed into 1 em tall rows, you’ll probably want to adjust your grid-template-rows (e.g. make rows 2–4 taller or let them auto-size with auto instead of 1em). Let me know if you’d like to see an example!