Should I use a web font or a font already on the visitor's device?
MDN calls the fonts available on nearly every system "web safe fonts" and says only a limited number of them can be used without worry [1]. You cannot know in every case which font a visitor's computer has [1]. A web font removes that guess: you ship the font file with the site, and MDN describes this as going beyond the web safe set to use custom fonts [2].
The rule is written in two parts. A @font-face rule names the file to download, and a font-family rule then applies it, followed by fallbacks [2]. MDN's example ends with the generic serif family, which gives a system font if the web font cannot load [2].
@font-face {
font-family: "BrandSans";
src: url("brandsans.woff2") format("woff2");
}
body { font-family: "BrandSans", Arial, sans-serif; }How much space should sit between lines of text?
MDN says text is easier to read when lines are spaced apart, and gives around 1.5–2 as the recommended line height [1]. It adds that a unitless value acts as a multiplier of the font size [1].
WCAG 2.2 sets a separate test, Success Criterion 1.4.12 at Level AA. When a reader overrides the spacing, no content or functionality should be lost [3]. The values it uses are below. The page does not have to use them by default; it only has to survive them [3].
| Property | Value WCAG tests with |
|---|---|
| Line height | At least 1.5 times the font size [3] |
| Spacing after paragraphs | At least 2 times the font size [3] |
| Letter spacing | At least 0.12 times the font size [3] |
| Word spacing | At least 0.16 times the font size [3] |
In practice this means text boxes, buttons and menus should grow with their words instead of cutting them off. The W3C lists clipped or overlapped content as a failure of this criterion [3], so check boxes with a fixed height on a responsive design layout.
Is my text dark enough against its background?
MDN, summarising WCAG, says text and its background should have a contrast ratio of at least 4.5:1, and heading or larger text at least 3:1 [4]. Larger text means at least 18pt, or 14pt bold [4].
A worked example
Say a clinic prints its opening hours in pale grey on a white banner because it looks calm. Paste the two colour codes into a contrast checker. If the ratio comes out under 4.5:1, darken the grey until it passes. The design keeps its mood and the hours become readable in bright sunlight on a phone.
- Check body text, button labels and form hints, not only headings [4].
- Check text laid over photos at the lightest and darkest parts of the photo.
- Re-check after any brand colour change.
Pair your type choices with a written set of rules, as described in design system.
Questions people ask
What font size should a website use?
No source sets one number. MDN says the common units for sizing text are px and em, among others, and WCAG tests that text can be spaced out without loss [1][3]. Pick a comfortable body size, then test it on a phone.
Is typography the same as the font?
No. The font is one choice inside typography. Typography also covers size, weight, line height, letter and word spacing, and colour, all of which MDN lists as separate CSS properties [1].
Do I need WCAG text spacing on a small business site?
WCAG says content should not lose information or function when a reader sets the spacing values in the criterion [3]. It is a test of the page, not a style you must apply to every reader.
Pages that link here
See also
- Accessibility Web accessibility means designing websites so that people with disabilities can perceive, understand, find their way around and use them.
- WCAG WCAG is the international standard from the W3C that sets testable rules for making web content usable by people with disabilities.
- UX design UX design is the work of shaping how a person experiences a company, its services and its products, from first click to after the sale.
- Design system A design system is a shared set of standards, reusable parts and patterns that keeps every page or screen of a product looking and working the same.
- Responsive design Responsive design is a way of building one website so its layout adapts to the screen it is shown on, from phone to desktop.
- Landing page A landing page is the page a person arrives on after clicking your ad, and it should match what the ad promised.
References
- Fundamental text and font styling, MDN Web Docs. Read 27/11/2026.
The recommended line height is around 1.5–2 (double–spaced).
- Web fonts, MDN Web Docs. Read 27/11/2026.
The generic serif family provides a system-font fallback if the web font cannot be loaded.
- Understanding Success Criterion 1.4.12: Text Spacing, W3C. Read 27/11/2026.
Line height (line spacing) to at least 1.5 times the font size;
- Color contrast, MDN Web Docs. Read 27/11/2026.
Text and its background should have a contrast ratio of at least 4.5:1.