Sub topic 1
Why Layouts Use Grids
Prerequisites
This chapter assumes you know basic typography terms: point size, leading (the space between lines of text) and line length. It also assumes you have used a layout tool such as InDesign, Affinity Publisher or Figma. The later implementation chapters use basic HTML and CSS. This chapter needs no code beyond one short example.
What a grid is
A layout grid is a set of invisible guides that divides a page or screen into regions. You place text, images and other elements against those guides instead of positioning each one by eye. The guides do not print and do not show on the screen. They only decide where things may start, end and line up.
A grid is a system of decisions made once and reused many times. You choose the margins, the number of columns and the space between them at the start of a project. Each page then follows those choices.
Why designers use grids
Grids solve four practical problems.
- Consistency. Page 4 and page 40 of the same publication share the same margins and column edges, so the reader sees one document.
- Speed. Placing an element means snapping it to a guide. You no longer decide its position from scratch every time.
- Readability. A grid ties text width to type size, so lines stay at a comfortable length.
- Collaboration. Several people can add pages or components to the same project, and the work still fits together.
Alignment also gives the eye a clear path. When the left edges of a headline, a paragraph and an image sit on the same vertical line, the reader's eye follows that line without effort. Elements that almost align look like mistakes.
Grids in print and on screen
Print and digital layouts use the same ideas but face different constraints.
| Concern | Digital | |
|---|---|---|
| Page size | Fixed, such as A4 at 210 mm wide | Varies with the viewport |
| Units | Millimeters, points, picas | Pixels, rem, percentages, fractions |
| Special margins | Binding margin, bleed | None, but safe areas on some devices |
| Adjustment | Set once before printing | Recalculated as the window changes |
The chapters that follow cover each difference in turn. The shared logic is that a grid sets rules, and content follows them.
A grid in code
You can see the idea in a few lines of CSS. This rule creates a twelve-column grid and places two elements on it.
.page {
display: grid;
grid-template-columns: repeat(12, 1fr);
column-gap: 1.5rem;
max-width: 72rem;
margin-inline: auto;
}
.article { grid-column: 1 / span 8; }
.sidebar { grid-column: 9 / span 4; }The article covers columns 1 to 8 and the sidebar covers columns 9 to 12. Their edges line up with the grid, and the gap between them equals the gutter. You do not calculate any pixel positions. The grid does it for you.
Types of grid
The rest of this tutorial covers three families.
- Single-column grid. One block of text inside margins, as in a novel.
- Multi-column grid. Vertical columns separated by gutters, as in newspapers and most websites.
- Modular grid. Columns crossed by rows, which makes a field of equal blocks called modules. Magazines, catalogs and dashboards often use it.
Each family builds on the one before it. A modular grid is a multi-column grid with horizontal divisions added.
Common mistakes
- Choosing columns before knowing the content. A grid built for long articles fits a catalog of small product images badly. Look at the content first.
- Treating guides as optional. If elements sit near the guides but not on them, you get the misalignment that a grid exists to prevent.
- Copying a grid between media. A grid designed for A4 print does not carry over to a phone screen without changes.
Exercise
A designer puts a headline, a body paragraph and a photo on a page. The left edge of each is a few millimeters different from the others. Name two problems this causes that a grid would prevent.
Show answer
The page looks careless, because near-alignments read as errors. The reader's eye also has no single vertical line to follow. A grid gives all three elements the same left edge, and it saves the designer from positioning each one by eye.
Exercise
In the CSS example, the article uses grid-column: 1 / span 8 and the sidebar uses grid-column: 9 / span 4. How many columns do the two elements use together, and what does that tell you about the page?
Show answer
Together they use 12 columns, which is the whole grid. The two elements fill the page width with no overlap and no unused column.