Sub topic 11
Diagnosing and fixing a weak layout
This chapter assumes you know the four principles from earlier chapters: contrast, alignment, repetition, and proximity. It also assumes you can read basic CSS. The goal is a method. You will look at a layout that feels wrong, name the cause, and apply the smallest fix that works.
Why diagnosis comes before fixing
"It looks off" is a reaction, not a diagnosis. If you act on a reaction, you tend to change many things at once: a new font, a new color, more padding. The layout may look different afterward, but you won't know why it improved, or whether it improved at all.
Diagnosis maps a visible symptom to a missing or misused principle. Each principle fails in a recognizable way, so a symptom points to a small set of likely causes. You then fix those causes and leave the rest of the design alone.
A repeatable critique routine
Use the same sequence each time. The order matters because early checks often explain later symptoms.
The routine follows the reader's experience. First the eye lands somewhere (hierarchy, which contrast creates). Then it groups what it sees (proximity). Then it looks for structure (alignment). Last, it learns the pattern and expects it to hold (repetition).
Step 1: Squint
Blur your eyes, or apply a blur filter to a screenshot. Detail disappears and only the large shapes and dark and light areas remain. Ask two questions:
- What do I see first?
- What do I see second?
If the first thing is a decorative border and the headline comes third, hierarchy has failed. If everything has equal weight, nothing leads. Both symptoms usually mean contrast is too weak or is spread across too many elements.
Step 2: Name the groups
Look at the layout without reading it and count the clusters you perceive. Compare that count to the number of ideas the content actually has. A mismatch means proximity is wrong. Either unrelated items sit too close, so groups merge, or related items sit too far apart, so one idea breaks into pieces.
Step 3: Trace the edges
Imagine drawing vertical lines along every left edge, and horizontal lines along baselines and tops. A sound layout has a small number of lines that many elements share. A weak one has many lines that almost match. Near-misses of a few pixels are worse than clear differences, because they read as mistakes.
Step 4: Check the family resemblance
Compare elements that do the same job: two buttons, three cards, every section heading. If they differ in font, size, spacing, or color without a reason, repetition is broken.
From symptom to cause
This table is a starting point. One symptom can have more than one cause, so confirm each guess against the layout.
| Symptom you notice | Likely missing principle | First thing to check |
|---|---|---|
| Nothing stands out; the page feels flat | Contrast | Are the size, weight, or color differences between levels small? |
| Two elements look different, but not clearly so | Contrast | Is the difference a "maybe" (18px vs 20px) instead of a decision? |
| Label appears closer to the wrong field | Proximity | Is the space above the label equal to the space below it? |
| Everything is evenly spaced, so it feels like a list of unrelated lines | Proximity | Is one spacing value used for every gap? |
| Layout feels messy though nothing is wrong individually | Alignment | Are there several left edges within a few pixels of each other? |
| Text is centered in some blocks and left-aligned in others | Alignment | Does each choice have a reason? |
| Two buttons or cards look like they came from different sites | Repetition | Do they share font, radius, padding, and color? |
| Text is hard to read even though it is large | Contrast (legibility) | What is the measured color contrast ratio? |
A worked example
Here is an event card with a weak layout. The markup is fixed, and only the CSS will change.
<article class="event">
<h2 class="title">Open Studio Night</h2>
<p class="date">Friday, 6 June, 6 pm</p>
<p class="where">Room 204, Arts Building</p>
<p class="desc">Meet the printmaking students, watch a live demo, and take home a small print.</p>
<a class="cta" href="#rsvp">RSVP</a>
</article>The first version of the CSS:
.event { width: 360px; font-family: Georgia, serif; }
.event .title { font-size: 20px; margin: 20px 0; text-align: center; }
.event p { font-size: 18px; margin: 20px 0; }
.event .date { text-align: right; color: #999999; }
.event .where { text-align: center; font-family: Verdana, sans-serif; }
.event .cta {
display: inline-block;
margin: 20px 0;
padding: 6px 10px;
background: #7fb2ff;
color: #ffffff;
}Running the routine
Squint. The title is 20px and the body text is 18px, so the title barely leads. The eye has no clear entry point. The page color is flat, and the button is pale, so the one action on the card is the quietest thing on it. This is a contrast problem.
Groups. Every element has margin: 20px 0, so every gap is the same. The date and location belong together, but they are separated like unrelated lines. The description and the button also look equally related to the title. This is a proximity problem. Equal spacing is the cause, not too little spacing.
Edges. The title is centered, the date is right-aligned, the location is centered, and the description is left-aligned. That produces four different alignments in five elements, and no shared edge. This is an alignment problem.
Family resemblance. The location uses Verdana while everything else uses Georgia. There is no reason for it. This is a repetition problem. It is minor next to the others, but it is cheap to fix.
Legibility. The date color #999999 on white has a contrast ratio of about 2.8:1. White text on the #7fb2ff button is about 2.2:1. WCAG 2.x asks for at least 4.5:1 for normal-size text. Both fail.
Choosing the fix order
You found five problems. Fix them in this order:
- Alignment and proximity first, because they change positions and spacing. Changing them later would disturb any size decisions you made around them.
- Contrast next, once you know which groups exist and which one should lead.
- Repetition and tokens last, as a cleanup that makes the decisions durable.
Here is the revised CSS:
:root {
--color-text: #1a1a1a;
--color-muted: #595959;
--color-accent: #0b5fff;
--space-sm: 8px;
--space-md: 16px;
--space-lg: 32px;
}
.event {
width: 360px;
font-family: Georgia, serif;
color: var(--color-text);
text-align: left;
}
.event .title {
margin: 0 0 var(--space-md);
font-size: 1.75rem;
font-weight: 700;
line-height: 1.2;
}
.event .date,
.event .where {
margin: 0;
font-size: 1rem;
color: var(--color-muted);
}
.event .desc {
margin: var(--space-md) 0 var(--space-lg);
font-size: 1rem;
line-height: 1.5;
}
.event .cta {
display: inline-block;
padding: var(--space-sm) var(--space-md);
background: var(--color-accent);
color: #ffffff;
font-weight: 700;
text-decoration: none;
}What each change did
- Alignment. Every element is left-aligned and shares one edge. The five alignment choices became one.
- Proximity. The date and location now have no gap between them, so they read as one "when and where" group. The gap above the description is 16px, and the gap above the button is 32px. Three distinct gap sizes (0, 16, 32) now map to three levels of relatedness.
- Contrast. The title is 1.75rem and bold against 1rem body text, a clear size and weight step. The button is bold white on
#0b5fff(about 5.1:1), and it is the only filled shape, so it stands out. The muted gray#595959on white is about 7:1, so it recedes without becoming hard to read. - Repetition. The stray Verdana is gone, and all colors and spacing come from the custom properties.
When symptoms mislead
Some diagnoses fail on the first guess. Watch for these cases.
Spacing looks wrong but the real problem is alignment. If a heading seems too far from its paragraph, check whether the paragraph is indented a few pixels. A misaligned edge can make a gap look larger than it is.
The hierarchy looks weak but the problem is too much contrast. When four things are bold, large, and colored, the eye has no first stop. Fix this by removing emphasis from three of them, not by adding more to the fourth.
Proximity fixes break alignment. Moving an element closer to its group can pull it off the shared edge. After each spacing change, recheck the edges.
Consistency hides a wrong choice. A layout can repeat a flawed pattern perfectly. If every card has a low-contrast label, repetition is working and legibility is failing. Diagnose each pattern once, then confirm it holds everywhere.
Content is the problem. If a card has seven pieces of information at equal importance, no spacing will help. The fix is to cut or demote content, which is an editorial decision. Raise it with whoever owns the content instead of forcing the layout to compensate.
Verifying the fix
A fix needs evidence, just as a code change needs a test.
- Squint again. The first thing seen should now be the title, then the button.
- Grayscale check. Turn the screenshot to grayscale. If the hierarchy survives, it does not depend on hue alone.
- Measure contrast. Use your browser's developer tools or a contrast checker on every text and background pair. Do this for muted text and button labels first, because they fail most often.
- Edge check. Turn on guides, or outline all elements in the browser, and confirm that the left edges coincide exactly.
- Spacing audit. List every gap in the layout. If you find values like 14px, 15px, and 17px, round them to your tokens or give each a reason.
Exercises
Exercise
A pricing page uses 16px of space between every pair of elements: the plan name, its price, its feature list, and the sign-up button. Viewers say the page "feels like one long list." Which principle is the main cause, and what is one fix?
Show answer
Proximity is the main cause, because equal spacing gives no grouping signal. A fix is to use tighter spacing between the plan name and price (for example 4px to 8px) so they read as one unit, a larger gap before the feature list (16px), and the largest gap before the button (32px). The gap sizes then reflect how closely the items relate.
Exercise
In the worked example, why is alignment and proximity fixed before contrast, and why does the diagnosis of contrast include a measured ratio instead of only a visual judgment?
Show answer
Alignment and proximity change positions and gaps, and the size and weight decisions in contrast depend on which groups exist and which should lead, so fixing them first avoids redoing contrast work. Contrast for legibility needs a measured ratio because perception varies by screen, lighting, and viewer. WCAG 2.x sets 4.5:1 as the minimum for normal-size text, so a number gives a pass or fail result that opinion cannot.