--- url: "https://www.w3.org/WAI/WCAG22/Techniques/css/C12" titulek: "C12: Using percent for font sizes | WAI | W3C" h1: "Technique C12:Using percent for font sizes" popis: "" jazyk: "en" kanonicka: "" drobecky: [] zdroj: "live" wayback_snapshot: "" stazeno: "2026-09-14 04:44:18" znaku: 2190 slov: 301 kodovani: "utf-8" sha256: "bf5c8670c8d10fed5a1e98be4f014306b2d4eb6221e44637844eb48fcc9dbfd9" --- # Technique C12:Using percent for font sizes ## About this Technique This technique relates to: - [1.4.4 Resize Text](https://www.w3.org/WAI/WCAG22/Understanding/resize-text) ( **Sufficient** when used for techniques for relative measurements) - [1.4.5 Images of Text](https://www.w3.org/WAI/WCAG22/Understanding/images-of-text) ( **Advisory** ) - [1.4.8 Visual Presentation](https://www.w3.org/WAI/WCAG22/Understanding/visual-presentation) ( **Sufficient** when used with [G146: Using liquid layout](../general/G146) ) - [1.4.9 Images of Text (No Exception)](https://www.w3.org/WAI/WCAG22/Understanding/images-of-text-no-exception) ( **Advisory** ) This technique applies to CSS. Techniques are examples of ways to meet Web Content Accessibility Guidelines (WCAG). They are **not required** to meet WCAG. Content can satisfy the normative requirements of WCAG even if it does not use any of the documented techniques. See [About WCAG Techniques](https://www.w3.org/WAI/WCAG22/Techniques/about). ## Description The objective of this technique is to specify text font size proportionally so that user agents can scale content effectively. If a `font-size` is specified for the `body` element, all other elements inherit that value, unless overridden by a more specific selector. ## Examples ### Example 1: Percent font sizes in CSS This example defines the font size for the `strong` element so that its text will always be larger than the surrounding text, in whatever context it is used. Assuming that headings and paragraphs use different font sizes, the emphasized words in this example will each be larger than their surrounding text. ```
Since only the user can know what size text works for them, it is very important to let them configure the text size.
``` ## Related Resources *No endorsement implied.* - [Cascading Style Sheets, Fonts](https://www.w3.org/TR/css-fonts-3/) . - [CSS `font-size` property](https://www.w3.org/TR/css-fonts-3/#font-size-prop) . ## Tests ### Procedure 1. Check that the value of the CSS property that defines the font size is a percentage. ### Expected Results - Check #1 is true Back to Top