Sub topic 6
Order the elements so the offer is read first
This chapter covers visual hierarchy: how size, weight, color, spacing and position decide what a visitor reads first, second and third in a hero. It assumes you can write basic HTML and CSS, and that you already have a headline, a subheadline and a primary call to action (CTA) from the earlier chapters. The running example is the Ledgerly hero: "Send invoices in under a minute".
What visual hierarchy does
Visual hierarchy is the order in which the eye moves across a page. A visitor does not read a hero from top to bottom like a book. They scan it. In the first second they pick out the largest, darkest or most contrasting thing. In the next few seconds they look for what it means and what to do about it.
For a hero, the target order is:
- The headline, which states the offer.
- The subheadline, which adds who it is for and how it works.
- The primary CTA, which says what happens next.
- The supporting visual and trust signals.
The visual is often the biggest object on screen. That makes it the most common cause of a broken hierarchy: the picture wins attention and the offer gets read late or not at all. Your job is to make the picture support the order above instead of competing with it.
The tools of hierarchy
You have a small set of levers. Using several together on one element makes it dominant. Using the same lever equally on everything cancels it out.
| Lever | What it does | Hero example |
|---|---|---|
| Size | Larger elements are seen first | Headline at `clamp(2rem, 5vw, 3.5rem)` against 1.125rem body text |
| Weight | Heavier type reads as more important | Bold headline, regular subheadline |
| Contrast | Strong difference from the background draws the eye | Dark text on a light page, a saturated button color |
| Color | A single accent color marks the action | Blue button on a neutral page |
| Space | Empty space around an element isolates it | Margin around the CTA, tight spacing inside the text group |
| Position | Top and left (in left-to-right languages) are read first | Text column before the image in the source and on wide screens |
A useful rule is to give each rank one clear step down from the one above. If the headline is 56px and the subheadline is 54px, the visitor cannot tell which comes first. If the subheadline is 18px, the order is obvious.
Apply it to the Ledgerly hero
Here is the HTML from the spine. The source order already matches the reading order: heading, subheadline, CTA, note, then image.
<section class="hero" aria-labelledby="hero-title">
<div class="hero__text">
<h1 id="hero-title">Send invoices in under a minute</h1>
<p class="hero__sub">Ledgerly helps freelancers create, send and track invoices, so you get paid sooner.</p>
<a class="hero__cta" href="/signup">Start free trial</a>
<p class="hero__note">No credit card required</p>
</div>
<img class="hero__image" src="/img/invoice-editor.webp" width="640" height="400" fetchpriority="high" alt="Ledgerly invoice editor showing a draft invoice with a Send button">
</section>Keeping the text first in the source matters for three reasons. Screen reader users hear the offer before the image description. Keyboard users reach the CTA before anything decorative. On a phone, where the layout collapses to one column, the text appears above the image without any extra CSS.
Now the CSS, which assigns each element its rank:
.hero {
display: grid;
gap: 2rem;
align-items: center;
padding: 3rem 1.25rem;
max-width: 72rem;
margin-inline: auto;
}
.hero h1 {
font-size: clamp(2rem, 5vw, 3.5rem);
line-height: 1.1;
margin: 0 0 1rem;
}
.hero__sub {
font-size: 1.125rem;
max-width: 40ch;
margin: 0 0 1.5rem;
}
.hero__cta {
display: inline-block;
padding: 0.875rem 1.5rem;
background: #0b5fff;
color: #fff;
border-radius: 0.5rem;
font-weight: 600;
text-decoration: none;
}
.hero__image {
width: 100%;
height: auto;
}
@media (min-width: 48rem) {
.hero {
grid-template-columns: 1fr 1fr;
}
}Reading the rules as a hierarchy:
- Headline. It is the largest type and has a tight
line-heightof 1.1, so a two- or three-line headline stays a single visual block. Size does most of the work here. - Subheadline. At 1.125rem it is clearly smaller than the headline but larger than ordinary body text.
max-width: 40chkeeps lines short enough to read in one glance. - CTA. It is small in area but is the only element with a saturated fill. Color and contrast, not size, make it stand out. The
paddinggives it a target large enough to tap. - Note. The line "No credit card required" is small, quiet text under the button. It removes a worry without competing with the button.
- Image. It sits in the second grid column on wide screens and below the text on narrow ones. It is large, but it has no strong color accent and no text of its own to pull the eye away from the headline.
Grouping with space
Space tells the eye which things belong together. In the CSS above, the headline has a 1rem bottom margin and the subheadline has 1.5rem. The gap between the text group and the image is 2rem. The headline and subheadline read as one message, and the button reads as the conclusion of it.
A common mistake is to space everything evenly. When the headline, subheadline, button and note are all separated by the same gap, the hero looks like a list of unrelated items. A better pattern is tight spacing inside a group and larger spacing between groups.
You can make this explicit with a small adjustment:
.hero__text > * + * {
margin-top: 1rem;
}
.hero__text > .hero__cta {
margin-top: 1.5rem;
}
.hero__text > .hero__note {
margin-top: 0.5rem;
font-size: 0.875rem;
}If you use this approach, remove the individual margin values from .hero h1 and .hero__sub so the two systems do not conflict. Note the small margin-top on the note: it keeps the note attached to the button it explains.
Common errors
Two things shouting at once. A bright image, an accent-colored headline and a bright button all fight for first place. Pick one accent color and use it for the action. Let the headline be dark and plain.
A secondary CTA that looks as strong as the primary. A second button such as "Watch demo" is allowed, but it needs a lower rank: an outline or plain text link instead of a filled button. Two filled buttons force the visitor to decide before they have understood the offer.
Small type for the offer. Designers often shrink the headline to fit a long sentence. If the headline needs to be that long, the offer is probably not yet sharp enough. Go back to the one-sentence offer and cut.
Color alone as the signal. If the only difference between the CTA and surrounding text is hue, it can disappear for people with color vision deficiency or on a washed-out screen. Pair color with a filled shape, weight and padding, as the .hero__cta rule does.
Visual order that differs from source order. CSS properties such as order or grid-area can place the image first on screen while it is last in the HTML. Keyboard focus and screen readers follow the source, so the two orders disagree. Keep them aligned unless you have a reason not to.
A quick way to check the hierarchy
Two simple tests need no tools beyond your browser.
- The squint test. Zoom out or squint until the text blurs. The shapes that remain should be the headline, then the button. If the image is the only thing left, it is dominating.
- The five-second test. Show the hero to someone for five seconds, hide it, and ask what the product does and what you can do next. If they cannot say, the order is not working.
Edge cases
- Long translated headlines. German or Finnish text can run much longer than English. The
clamp()size and generousline-heighthelp, but test the longest language you support and make sure the CTA still appears above the fold. - Dark hero backgrounds. On a dark or photographic background, the CTA must still contrast with its surroundings. A blue button on a dark blue image can vanish, so check the contrast between the button and what is behind it, not only between the button text and the button.
- Wide screens. At large widths,
max-width: 72remstops the layout from stretching. Without it, the text column can become too wide and the headline loses its tight grouping. - Narrow screens. When the grid collapses to one column, the image arrives after the CTA. If the image is tall, the CTA should still sit within the first screen of scrolling. The next chapters on layout and responsive behavior return to this.
Exercise
A hero has a 56px bold headline, a 54px bold subheadline, a filled blue "Start free trial" button and a filled green "Watch demo" button of equal size. Name two hierarchy problems and one fix for each.
Show answer
First, the headline and subheadline are nearly the same size and weight, so the eye cannot tell which to read first. Fix: reduce the subheadline to about 18px and use regular weight. Second, the two filled buttons of equal size compete, so the visitor must choose before understanding the offer. Fix: keep "Start free trial" as the filled primary button and restyle "Watch demo" as an outline button or plain text link.
Exercise
In the Ledgerly hero, the designer uses order: -1 on the image so that it appears above the text on phones. What is the accessibility cost, and what is a safer alternative?
Show answer
Keyboard focus and screen readers follow the HTML order, which still has the text first, so the visual order and the reading order no longer match. The visible image comes first while assistive technology reaches the headline first. A safer alternative is to leave the source order as it is and keep the text above the image on phones, or, if the image must come first, move it earlier in the HTML so both orders agree.