Sub topic 5
Grids and shared edges
This chapter covers how a grid gives alignment a structure you can reuse across a layout. It assumes you know the basics from the previous chapter: that each element should line up with something else on the page. It also assumes you can use a design tool such as Figma, Canva, or InDesign, and that you know terms like heading, body text, and line spacing.
What a grid does
A grid is a set of invisible guide lines that you place elements against. Each line is a shared edge. When a heading, an image, and a paragraph all start at the same vertical line, the eye reads that line as a single edge and the layout feels organized.
Alignment on its own is a decision you make for each element. A grid is that decision made once. You choose the lines first, then place every element against them.
A grid has three parts:
- Columns are the vertical bands that hold content.
- Gutters are the gaps between columns. They keep neighboring content from touching.
- Margins are the empty space between the content and the edge of the page.
Shared edges in practice
A shared edge can be the left side of a column, the right side, or a center line. Left edges are the most common for Western languages because text starts at the left and the eye returns to that line at the start of each row.
Here is a two-column page in CSS. The left column holds a short label and the right column holds the main content. Both columns use align-items: start, so their tops line up. The text is left-aligned inside each column, so the content in each column starts on one edge.
.page {
display: grid;
grid-template-columns: 1fr 2fr;
column-gap: 24px;
align-items: start;
}
.page > * {
text-align: left;
}The 1fr 2fr value gives the second column twice the width of the first. The column-gap is the gutter. Every element you add to .page falls into one of the two columns, so you cannot place one at an arbitrary offset by accident.
Choosing a column count
The number of columns depends on how much variety your content needs.
| Columns | Typical use | Trade-off |
|---|---|---|
| 1 | Articles, long reading, mobile screens | Simple, but gives little room for side content |
| 2 | Text with a sidebar, or an image beside text | Clear structure, limited variety |
| 3 | Cards, product lists, newsletters | Flexible, but narrow columns can make text hard to read |
| 12 | Web frameworks and complex dashboards | Many layouts from one grid, but more planning |
A 12-column grid is popular because 12 divides evenly by 2, 3, 4, and 6. You can build halves, thirds, and quarters from the same lines.
Breaking the grid on purpose
A grid is a default, not a rule you must obey in every case. You can let one element cross several columns, such as a full-width image or a large heading. This works because the rest of the layout still follows the grid. The exception stands out, and that creates contrast.
The risk is breaking the grid by accident. An element that is a few pixels off a shared edge looks like a mistake, not a choice. If you break the grid, break it by a clear amount.
Common errors
- Nearly aligned elements. Two items that differ by 2 or 3 pixels look like an error. Snap them to the same guide.
- Mixed alignment. Combining left-aligned headings with centered body text on the same page creates two competing edges.
- Ignoring gutters. Without a gutter, columns of text run together. Use the same gutter width everywhere.
- Setting up the grid after the content. Placing elements first and adding guides later usually means nudging every item. Set the guides first.
Exercise
A page has a left-aligned heading, a centered paragraph, and an image that starts 6px to the right of the heading's left edge. Name two problems and say how a grid fixes them.
Show answer
First, the paragraph is centered while the heading is left-aligned, so the page has two competing edges. Second, the image sits 6px off the heading's edge, so it looks like a mistake. With a grid, you left-align all three elements to the same column line. The heading, paragraph, and image then share one edge.
Exercise
You are designing a three-column card layout with a 24px gutter. Why should you use the same 24px gutter between every pair of columns?
Show answer
Equal gutters make the spacing predictable and keep the shared edges regular. Uneven gutters make some columns look closer together than others, which suggests a relationship that does not exist and weakens the grid.