Sub topic 7
Grids, Spacing, and Alignment
This chapter assumes you can already sketch a rough screen and know the main regions of a layout (header, navigation, content, sidebar, footer). It also assumes you have a screen inventory to work from. Here you will put those regions on a grid, space them consistently, and align them so the layout reads as intentional.
Why wireframes need a grid
A grid is a set of invisible guides that decide where elements may sit. Without one, each element is placed by eye. Small differences pile up. Cards end up 3 px apart in one row and 11 px apart in the next, and a developer has to guess which value you meant.
A grid gives you three benefits at wireframe stage:
- Speed. You snap elements to guides instead of nudging them.
- Consistency. Similar elements get the same width and gap on every screen.
- Translatable decisions. Developers build layouts with grid systems (CSS Grid, Flexbox, native layout containers). A wireframe on a grid maps almost directly to code.
A wireframe does not need final visual polish. It does need honest proportions, because proportions are what you are testing.
The parts of a column grid
A column grid has four parts:
| Part | Meaning | Typical wireframe value |
|---|---|---|
| Columns | Vertical strips that content spans | 4 (phone), 8 (tablet), 12 (desktop) |
| Gutter | Gap between columns | 16 px phone, 24 px desktop |
| Margin | Space between the grid and the screen edge | 16 px phone, 24–64 px desktop |
| Container | Maximum width of the grid | Often 1140–1280 px on desktop |
Content spans whole columns. A main area that spans 8 of 12 columns and a sidebar that spans 4 fill the row exactly. A main area that spans 7 and a sidebar that spans 4 leave an orphan column, which looks like a mistake.
Common column counts are 4, 8 and 12. The number 12 divides evenly by 2, 3, 4 and 6, so it supports many layouts: halves, thirds, quarters, and a 2/3 and 1/3 split.
A grid in code
The spine's CSS example shows how a wireframe grid becomes working layout. It uses 4 columns on phones, 8 on tablets from 768 px, and 12 on desktops from 1024 px.
.wf-box { border: 1px solid #888; background: #f2f2f2; padding: 8px; }
.wf-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; }
.wf-main, .wf-side { grid-column: 1 / -1; }
@media (min-width: 768px) {
.wf-grid { grid-template-columns: repeat(8, 1fr); }
}
@media (min-width: 1024px) {
.wf-grid { grid-template-columns: repeat(12, 1fr); gap: 24px; }
.wf-main { grid-column: span 8; }
.wf-side { grid-column: span 4; }
}Read it as a spec. By default both regions use grid-column: 1 / -1, which means "from the first line to the last line", so each takes the full width and they stack. At 1024 px and up, the main region spans 8 columns and the sidebar spans 4, so they sit side by side. Responsive behavior is covered fully in a later chapter. Here the point is that a grid turns a layout decision into a number you can write down.
Spacing with a base unit
Spacing is the second half of layout. Choose a base unit and build every gap from multiples of it. The most common choice is 8 px, with 4 px allowed for tight spots such as the gap between an icon and its label.
A usable spacing scale:
| Token | Value | Typical use |
|---|---|---|
| xs | 4 px | Icon to label |
| sm | 8 px | Inside compact controls |
| md | 16 px | Between related elements, gutters on phones |
| lg | 24 px | Between groups, gutters on desktop |
| xl | 32 px | Between sections |
| 2xl | 48 px | Major section breaks |
Limit yourself to these values. When every gap is one of six numbers, the viewer sees a pattern. When gaps are arbitrary, the viewer sees noise.
Proximity carries meaning
Spacing is also communication. Elements that are closer together read as related. A label should sit closer to its own field than to the field above it. A section heading should sit closer to its content than to the previous section.
Apply this rule: the space around a group must be larger than the space inside it. If the gap between two form fields is 16 px, the gap between two form sections should be 32 px or more.
Alignment
Alignment means sharing an edge or a center line. Most layouts rely on a few strong lines.
- Left-align text and controls in left-to-right languages. A shared left edge is the strongest line in most screens.
- Align to the grid, not to each other. If you align card B to card A and card A is slightly off, the error spreads.
- Use one alignment per group. Mixing left-aligned labels with centered values in the same list forces the eye to jump.
- Align baselines in rows. When a title and a button share a row, align the text baseline, not the top of the boxes.
- Avoid centered body text. Centering suits short headings and empty states. Paragraphs and lists read better flush left.
Right-to-left languages mirror these rules. If the product will ship in Arabic or Hebrew, note in the wireframe that the grid mirrors.
Worked example: the order history screen
Take the order history screen from the spine's HTML example. It has a header, navigation, a main list, a filter sidebar and a footer.
- Choose the grid: 12 columns, 24 px gutters, 24 px margins at 1280 px wide.
- Place the header and navigation across all 12 columns.
- Give the order list 8 columns and the filter sidebar 4 columns.
- Set the spacing: 16 px between order rows, 32 px between the page heading and the list, 48 px above the footer.
- Align the heading, the order rows and the filter title to the left edge of their own columns.
- Check the phone version: 4 columns, 16 px margins, filters moved below the list or behind a "Filters" button.
The matching HTML uses landmark elements, so the structure is clear before any styling.
<body class="wf">
<header class="wf-box">Logo | Search | Account</header>
<nav class="wf-box" aria-label="Primary">Home | Orders | Support</nav>
<main class="wf-grid">
<section class="wf-main wf-box">
<h1>Order history</h1>
<ul>
<li>Order #1001 - Shipped</li>
<li>Order #1002 - Delivered</li>
</ul>
</section>
<aside class="wf-side wf-box">Filters</aside>
</main>
<footer class="wf-box">Help | Terms</footer>
</body>Common errors
- Using a grid without margins. Content touches the screen edge on phones, which is hard to tap and read.
- Mixing spacing values. Gaps of 10, 14, 18 and 22 px look accidental and cannot be named in a spec.
- Spanning columns unevenly. Leaving orphan columns suggests missing content.
- Aligning to the wrong thing. Matching the previous element instead of the grid drifts over a long page.
- Designing only at one width. A layout that works at 1280 px may break at 800 px. Check at least one phone width and one wide width.
- Ignoring tap target size. On touch screens, leave room for controls at least 44 × 44 pt (iOS guidance) or 48 × 48 dp (Android guidance), with space between neighbors.
Documenting your grid
Put the grid and spacing values in the file where reviewers will find them: a short note on the template frame or a style page. Record columns, gutter, margin, container width, base unit and the spacing scale. This note becomes part of the annotations and handoff material in later chapters.
Exercise
A phone wireframe uses a 4-column grid with 16 px gutters. A card list shows two cards per row. How many columns should each card span, and what spacing rule should you apply between the card title and the card's price line versus between two cards?
Show answer
Each card spans 2 of the 4 columns, so the two cards fill the row. Use a smaller gap inside a card, such as 8 px between title and price, and a larger gap between cards, such as the 16 px gutter or more. Space inside a group must be smaller than space between groups, so the title and price read as one unit.
Exercise
A teammate's wireframe has a main area spanning 7 columns and a sidebar spanning 4 columns on a 12-column grid. What is wrong, and give two ways to fix it.
Show answer
The two regions use 11 columns, so one column is left empty and looks like missing content. Fix it by making the main area span 8 columns, or by making the sidebar span 5. Another valid fix is to place a deliberate element in the spare column, but that should be a decision rather than a leftover.