Sub topic 5
Headlines: the entry point
A headline is the first text most readers look at, and it decides whether they read the rest. This chapter covers what a headline does in a layout, how to size and style one against the body text, and the edge cases that break it. It assumes you know the basic vocabulary of type (typeface, font size, weight, italic) and can read simple HTML and CSS.
What a headline does
A headline states the main idea of a page, article, or section in a few words. In the hierarchy it has three jobs:
- It is the entry point. The eye lands on it first because it is the largest and heaviest text on the page.
- It tells the reader what the page is about, so they can decide whether to continue.
- It sets the top of the scale. Subheads and body text are ranked relative to it.
A page normally has one primary headline. If two elements compete for the top rank, the reader has no clear starting point, and the hierarchy is weaker even if each element looks fine alone.
Getting the size right
Size contrast is the strongest cue for rank, so the headline must be clearly larger than the body text. Earlier chapters built a type scale from a 1rem body size and a 1.25 ratio. On that scale the headline takes the highest step, 2.441rem, which is about 2.4 times the body size.
:root {
--step-0: 1rem;
--step-1: 1.25rem;
--step-2: 1.563rem;
--step-3: 1.953rem;
--step-4: 2.441rem;
}
body { font-size: var(--step-0); }
h3 { font-size: var(--step-1); }
h2 { font-size: var(--step-2); }
h1 { font-size: var(--step-4); }This example skips --step-3. That is a deliberate choice: the headline sits one step above where it would normally land, which widens the gap between the headline and the h2 below it. Skipping a step is a common way to make the top level more dominant without changing the ratio for the rest of the scale.
How large is large enough? A rough check is that the headline should be at least about twice the body size for article layouts. For marketing pages or posters, a larger jump is common. If the headline is only 1.2 times the body size, the two read as nearly the same level, and weight or color has to do all the work.
Leading and weight for large text
Large text needs less line height than body text. A unitless line height of 1.5 suits body text at 1rem. At 2.4rem, the same 1.5 leaves large gaps between lines, and a two-line headline starts to look like two separate items.
body {
font-family: Georgia, serif;
font-size: 1rem;
line-height: 1.5;
}
p {
max-width: 65ch;
}
h1 {
font-size: 2.441rem;
line-height: 1.15;
font-weight: 700;
}Here the headline uses a line height of 1.15, which keeps wrapped lines tight enough to read as one unit. Because a headline has few lines, the tighter leading does not hurt readability the way it would in a long paragraph.
Weight is a secondary cue. A bold headline (700) adds rank on top of size. It also helps at the smaller end of the headline range, where size alone may not separate the levels. Avoid stacking every cue at once. A headline that is huge, bold, italic, all caps, and colored reads as shouting, and it leaves nothing for the subheads to differentiate themselves with.
Marking up the headline
The visual hierarchy should match the structure in the markup. Semantic heading elements let CSS style each level and let assistive technology, such as a screen reader, move through a page by headings.
<article>
<h1>Headline states the main idea</h1>
<p class="lead">A short intro sentence in slightly larger text.</p>
<h2>Subhead introduces a section</h2>
<p>Body text carries the detail.</p>
</article>Choose the element by meaning, then style it by appearance. Do not use an h1 for a short, large label because it looks right, and do not use a div with a big font size as a headline. Screen reader users who jump between headings would miss it. The reverse also holds: if a design calls for a small headline, keep the h1 and reduce its size in CSS.
Use one h1 per page in most layouts. Do not skip levels, such as going from h1 to h4, because the gap suggests missing content to someone navigating by structure.
Writing and fitting the text
Typography cannot fix a headline that says nothing. A strong headline names the main idea in plain terms. "Quarterly results" is a label. "Revenue grew 12% in the third quarter" is a statement a reader can act on.
Length affects the layout directly:
- Short headlines (under about 40 characters) fit on one or two lines at large sizes.
- Long headlines wrap to three or more lines. At that point, consider a smaller step or a wider container.
- Headlines in a narrow column break awkwardly. A single long word can force an overflow or a very ragged edge.
For the wrapping itself, modern CSS offers text-wrap: balance, which distributes words evenly across lines so the last line is not a single orphaned word. Browser support has grown, but check your target browsers before relying on it. Without it, the headline still works, just with less even line breaks.
h1 {
text-wrap: balance;
}Responsive headlines
A fixed 2.441rem headline can be too large on a phone, where it wraps into five short lines, and too small on a wide desktop. Fluid sizing with clamp() keeps the headline in range. The function takes a minimum, a preferred value that grows with the viewport, and a maximum.
h1 {
font-size: clamp(1.75rem, 1.2rem + 2.5vw, 2.75rem);
}
body {
font-size: 1rem;
}At a narrow viewport the headline is 1.75rem, which is 1.75 times the body size. At a wide viewport it stops at 2.75rem, which is 2.75 times. The ratio between headline and body changes, but it never falls below the point where the headline stops looking like the top level. Check both ends, not only the middle.
The rem term in the preferred value matters. A value written only in vw ignores the user's browser font size setting, so a reader who has enlarged their default text would see no change. Mixing rem and vw keeps part of the size tied to the user's preference.
Common errors
| Error | Result | Fix |
|---|---|---|
| Headline too close to body size | No clear entry point | Use at least a 2x ratio in article layouts |
| Body line height on the headline | Wrapped lines look disconnected | Set line height near 1.1 to 1.2 |
| Several competing large elements | The eye has no starting point | Keep one primary headline per page |
| `h1` chosen for looks | Broken document outline | Pick by meaning, size with CSS |
| Skipped heading levels | Confusing navigation for assistive technology | Move down one level at a time |
| Fixed size on all screens | Overflow or lost dominance | Use `clamp()` and test both ends |
Checking the result
Two quick tests help. First, the squint test: blur your eyes or view the page at a small size. The headline should still be the first thing you notice, followed by the subheads, and the body text should fade into a gray texture. Second, remove color and decoration in your mind, or in the browser, and check whether size and weight alone still separate the levels. If the headline only stands out because of a bright color, the hierarchy depends on a cue that some readers cannot see.
The diagram shows how a reader's attention moves through a page when the headline is working.
Summary of the working model
A headline is the top step of the type scale. It is larger than the subheads by a visible margin, uses tighter leading than body text, may carry a heavier weight, and is marked up as the page's h1. It must work across screen sizes, and it must say something. Most failures come from too little contrast with the next level, too many competing elements, or ignoring how the text wraps.
Exercise
A page uses body { font-size: 1rem; line-height: 1.5; } and h1 { font-size: 1.1rem; font-weight: 400; line-height: 1.5; }. The headline wraps onto two lines and does not stand out. Name three changes that would strengthen it, and give a CSS rule that applies them.
Show answer
Increase the size so the headline is clearly larger than body text (about 2x or more), increase the weight, and reduce the line height so the wrapped lines read as one unit. For example: h1 { font-size: 2.441rem; font-weight: 700; line-height: 1.15; }. Adding text-wrap: balance; also evens out the line breaks.
Exercise
A designer sets h1 { font-size: 6vw; }. Explain one problem with this on a phone and one on a very wide monitor, and write a better declaration.
Show answer
On a phone the text can be too small, or if the viewport scales oddly it can ignore the reader's own font size setting, because vw does not respond to it. On a very wide monitor the headline keeps growing without limit and becomes oversized. A better declaration is h1 { font-size: clamp(1.75rem, 1.2rem + 2.5vw, 2.75rem); }, which sets a minimum and maximum and keeps a rem part tied to the user's settings.