Sub topic 4
Using a grid to organize text and images
What this chapter assumes
You should already know how to set type in a design tool such as Figma, InDesign or Illustrator. That means choosing a typeface, size and weight, and setting line spacing. You should also know what image resolution means. The previous chapters covered typography basics, the role of an image, and visual hierarchy. This chapter covers the structure that lets those decisions line up on the page.
What a grid does
A grid is a set of invisible guides that divide a page into regions. Every text block and every image snaps to those guides. The grid does not make a layout good. It removes accidental decisions, so the decisions that remain are deliberate.
A grid gives you three things:
- Consistency. Margins, gutters and image widths repeat across a page or a whole document.
- Alignment. Edges of type and edges of images share lines. The eye reads those shared lines as order.
- Speed. You stop nudging objects by eye and choose among a small set of valid positions.
When a type block and an image share an edge, the reader sees them as related. When they miss each other by a few pixels, the reader sees a mistake. Near misses are worse than clear differences.
The parts of a grid
| Part | What it is | Typical use |
|---|---|---|
| Margin | Empty border between content and the page edge | Keeps text from touching the trim or screen edge |
| Column | A vertical strip that holds content | Text blocks and images span one or more columns |
| Gutter | The gap between two columns | Stops adjacent text and images from crowding |
| Baseline grid | Evenly spaced horizontal lines | Keeps lines of text aligned across columns |
| Module | The cell where a row and a column cross | Sets the unit size for images |
Choosing a grid type
Pick the simplest grid that fits the content.
- Single-column grid. One wide text column, often with generous margins. Suited to essays, long articles and mobile screens. Images are full width or sit inside the column.
- Multi-column grid. Two to twelve columns. Text can span a few columns while images span others. A 12-column grid is common on the web because 12 divides evenly into 2, 3, 4 and 6.
- Modular grid. Columns plus horizontal rows, producing a field of modules. Suited to catalogs, dashboards and image-heavy pages, because every image can occupy a whole number of modules.
- Hierarchical (custom) grid. Regions drawn by hand around the content. Suited to posters and one-off layouts where the image dictates the structure.
Setting up a grid
Work in this order. Each step constrains the next.
- Fix the format: page size, screen width or artboard.
- Set the margins. Use the same value on all sides, or a larger bottom margin for print.
- Choose the number of columns.
- Set the gutter. Gutters are often between 16 and 24 px on screens, or about 4 to 6 mm in print.
- Set a baseline grid equal to your body text's line height. If body text is 16 px on 24 px leading, the baseline grid is 24 px.
- Define the image sizes you will allow, counted in columns or modules.
Aligning type to the grid
Body text sits in one or more columns. A line length of roughly 45 to 75 characters reads comfortably, so the column width should produce that range at your chosen size. If a column is too narrow, lines break awkwardly. If it is too wide, readers lose their place on the return sweep.
Left-aligned (ragged right) text keeps even word spacing and gives a strong left edge. Justified text needs a wide enough column, or it opens large gaps between words. For most layouts that mix type and images, left alignment is the safer choice.
Headlines can align to the same left edge as the body text. A common pattern is to hang a small label or caption in a narrow side column while the body occupies the wider main column.
Aligning images to the grid
An image should span a whole number of columns. A photo that spans two and a half columns breaks the system. Three details matter:
- Edges. The left and right edges of an image should fall on column edges, not in the gutter.
- Tops. Align the top of an image with the cap height or ascender line of the neighboring text, not with the top of the text box. Text boxes include extra space above the letters, so box alignment leaves the text looking lower than the image.
- Bottoms. Where an image ends beside a text column, end it on a baseline grid line so the text and picture finish together.
The same image can be a bleed image, which runs to the page edge, or a contained image, which stays inside the margins. Bleed images ignore the margins on purpose. Use them sparingly so they read as a deliberate choice and not as an error.
Breaking the grid on purpose
A grid is a default. Breaking it can add emphasis, provided the break is clear and rare. A single image that extends past the margin, or a headline that overlaps a photo's edge, will stand out because everything else obeys the grid. If you break the grid often, the effect is lost and the page looks careless.
A useful test: you should be able to say why each break exists. If you can't, snap the object back.
Grids in code
On the web, CSS Grid expresses the same ideas directly. The example below builds a 12-column grid with a 24 px gutter. An image spans five columns and the text spans seven, and both share the same top edge.
.layout {
display: grid;
grid-template-columns: repeat(12, 1fr);
column-gap: 1.5rem;
max-width: 72rem;
margin: 0 auto;
padding: 0 1.5rem;
align-items: start;
}
.layout__image {
grid-column: 1 / span 5;
}
.layout__image img {
display: block;
width: 100%;
height: auto;
}
.layout__text {
grid-column: 6 / span 7;
line-height: 1.5;
}Because both items use align-items: start, their top edges match. The image's display: block removes the small gap that inline images leave below them.
Common errors
- Too many column widths. If images are two, three, four and five columns wide with no pattern, the page has no rhythm. Choose two or three standard sizes.
- Ignoring gutters. An image that spans a gutter but not the next column ends in empty space, which looks unfinished.
- Margins that differ by accident. Check that the left and right margins match, and that the top and bottom follow a rule.
- Text that ignores the baseline grid. Mixed leading in neighboring columns makes lines sit at different heights. Headlines and captions should use multiples of the baseline unit.
- Aligning to the box, not the glyphs. Optical alignment often beats mathematical alignment. Large type has visible side bearing, so a big headline may need a small negative offset to look flush with body text.
- Cropping to fit the grid. Cropping an image to fit a column can remove its focal point. The next chapter covers how to find and protect it. Adjust the grid span first and crop second.
Checking your work
Review the finished page in this order:
- Turn on columns, margins and baseline guides.
- Confirm every text block starts on a column edge.
- Confirm every image edge lands on a column edge.
- Check that gutters are the same width everywhere.
- List the places where something breaks the grid and justify each one.
Exercise
A page uses a 6-column grid with a 20 px gutter. A designer places a photo so its right edge falls in the middle of the gutter between columns 3 and 4, and sets a text block starting at column 4. Name two problems and give a fix.
Show answer
First, the photo edge sits in the gutter instead of on a column edge, so it does not align with anything. Second, the text and image are not separated by a full gutter, so the spacing is uneven. Fix: make the photo span columns 1 to 3 so its right edge lands on the edge of column 3, and keep the text starting at column 4 so the gutter between them is the standard 20 px.
Exercise
Body text is set at 16 px with 24 px line height. A caption is set at 12 px. What line height keeps the caption on the baseline grid, and why?
Show answer
Use a line height of 24 px, or 12 px if the design allows a half-step baseline. Multiples of the baseline unit keep caption lines on the same horizontal lines as body text in neighboring columns. A line height such as 15 px would drift off the grid after the first line.