Sub topic 3
Line Length and Comfortable Measure
Assume you know basic type vocabulary and can read simple HTML and CSS. In a layout, measure is the width of a line of text. A comfortable paragraph usually spans about 45–75 characters, or roughly 60–65ch in CSS.
body {
font-size: 1rem;
line-height: 1.5;
}
p {
max-width: 65ch;
}Longer lines make it harder to find the next line. Very short lines create too many breaks and interrupt reading.
Spacing and Proximity
Spacing shows which elements belong together. Put more space before a subhead than after it. Then keep the paragraph close to the subhead it introduces.
h2 {
margin-top: 2em;
margin-bottom: 0.5em;
}
h2 + p {
margin-top: 0;
}Do not use equal spacing everywhere. Equal gaps flatten the hierarchy.
Choosing and Pairing Typefaces
Use a typeface with clear letterforms for body text. Pair a display typeface with a neutral text typeface only when their roles are distinct. Limit the page to one or two type families. Too many families add visual noise.
Weight and style can support hierarchy, but they should not replace meaningful size and spacing differences.
Color and Contrast for Legibility
Color can separate secondary text from primary text, but never make essential text depend on color alone. Check text against its background using WCAG contrast guidance:
- Normal text should reach a contrast ratio of at least 4.5:1.
- Large text should reach at least 3:1.
Alignment and Grid Support
Align headlines, subheads, and paragraphs to a shared edge or grid. Consistent alignment lets readers predict where the next text block begins. A different alignment should have a clear purpose, such as separating a caption from the article.
Adapting Across Screen Sizes
Keep the relationship between levels while changing their absolute sizes. clamp() allows a headline to grow between limits.
h1 {
font-size: clamp(1.75rem, 1.2rem + 2.5vw, 2.75rem);
line-height: 1.15;
}Check that headings do not wrap awkwardly and that body text remains near the intended measure.
Testing and Refining
Use the squint test: blur your eyes or step back. The headline should attract attention, subheads should divide the page, and body text should form a readable texture. Also inspect the page at phone and desktop widths.
Exercise
A paragraph stretches across a 1200-pixel desktop column. Name two changes that could improve its hierarchy and readability.
Show answer
Limit the paragraph to about 60–65ch, then verify the spacing, contrast, and heading relationship at both desktop and mobile widths.