Sub topic 4
Alignment: give every element a visual connection
This chapter assumes you can use a layout tool such as Figma, Canva, or InDesign, and that you know basic typography terms like font size, weight, and line spacing. You should also know common layout elements: headings, body text, images, and buttons.
What alignment does
Alignment means that every element on a page lines up with at least one other element along a shared edge or center line. The shared line is invisible, but the eye detects it. It reads as a connection, and the layout looks planned instead of scattered.
Robin Williams puts the rule this way: nothing should be placed on the page arbitrarily. Each item should have a visual tie to something else. That tie does not need to be physical contact. A heading and a photo can sit far apart and still feel related if their left edges match.
The common failure: near-misses
Most alignment errors are not wild. They are small. A caption starts 3px to the right of the image above it. A button sits a little off the text column. These near-misses look like mistakes, not choices. A clear difference looks intentional, and a tiny difference looks sloppy.
If two edges are close but not equal, make them equal or move them clearly apart.
Choosing an alignment
There are four common options.
| Alignment | Best for | Watch out for |
|---|---|---|
| Left | Body text, forms, most interfaces in left-to-right languages | Ragged right edge can look uneven if line breaks are poor |
| Right | Numbers in tables, short labels next to a left edge | Hard to read in long passages |
| Center | Short, formal items such as invitations, titles, a single call to action | Weak edges on both sides. Poor for multi-line paragraphs |
| Justified | Long text in print with a wide enough column | Uneven word gaps ("rivers") in narrow columns |
Pick one main alignment and use it throughout the layout. Mixing centered headings with left-aligned body text, with a right-aligned caption added in, creates three competing edges. If you do mix, do it with a reason.
Grids and shared edges
A grid is a set of columns and rows that you place elements on. It gives you many shared edges at once, so alignment becomes a habit instead of a judgment call.
The CSS below uses a two-column grid. Every item in the grid starts at a column edge, and text-align: left keeps the text edges matching.
.page {
display: grid;
grid-template-columns: 1fr 2fr;
column-gap: 24px;
align-items: start;
}
.page > * {
text-align: left;
}Two things do the work here. grid-template-columns fixes where the column edges are. align-items: start makes items in the same row share a top edge instead of stretching or centering at different heights.
In a design tool, the same idea comes from layout grids or guides. In Figma, add a layout grid to a frame. In InDesign, set columns and margins. In Canva, turn on rulers and guides. Then snap elements to the lines.
A worked example
Suppose a flyer has a centered title, a left-aligned paragraph, a photo that is 20px in from the margin, and a date set at the right. The page has four different edges, and nothing relates to anything else.
Fix it in steps:
- Choose left alignment as the main edge.
- Set a left margin and put the title, paragraph, and date on it.
- Move the photo to the same margin, so its left edge matches the text.
- If the photo needs a different position, make it clearly different, such as spanning two columns on the grid.
The content did not change. Only the edges did, and the page now looks organized.
Visual alignment versus box alignment
Matching bounding boxes does not always match what the eye sees. Large type often has side bearings, which are small gaps inside the text box, so a big heading can look indented relative to body text even though both boxes start at the same x position. Round shapes and icons look smaller than squares at the same size. Nudge by eye when the boxes say one thing and the page says another.
Check your understanding
Exercise
A card has a heading starting at x = 24px, a paragraph starting at x = 27px, and a button starting at x = 24px. Which element is misaligned, and what is the best fix?
Show answer
The paragraph is misaligned by 3px. This is a near-miss that looks accidental. Move the paragraph to x = 24px so all three share one left edge. Better still, put all three in a container with 24px padding so the edge is set once.
Exercise
Why is a two-column grid with align-items: start more reliable for alignment than positioning each element by hand?
Show answer
The grid defines the column edges once, and every item snaps to them. align-items: start gives items in the same row a common top edge. Hand positioning relies on judgment for each element, which allows small near-miss errors.