Techniques for WCAG 2.0

On this page:

-

# C13: Using named font sizes

## Applicability

CSS

This technique relates to:

- Success Criterion 1.4.4 (Resize text)
  - How to Meet 1.4.4 (Resize text)
  - Understanding Success Criterion 1.4.4 (Resize text)
- Success Criterion 1.4.8 (Visual Presentation)
  - How to Meet 1.4.8 (Visual Presentation)
  - Understanding Success Criterion 1.4.8 (Visual Presentation)

## User Agent and Assistive Technology Support Notes

When font size is given in absolute units of measurement, such as points or pixels, the Text Size menu commands in Internet Explorer 7 and earlier do not resize the text.

## Description

The objective of this technique is to specify a named font size that expresses the relative font size desired. These values provide hints so that the user agent can choose a font-size relative to the inherited font-size.

## Examples

### Example 1: Named font sizes in CSS

This example selects a larger font size for `strong` elements so that their text will always be larger than the surrounding text, in whatever context they are used. Assuming that headings and paragraphs use different font sizes, the emphasized words in this example will each be larger than their surrounding text.

Example Code:

    strong {font-size: larger}

    ...

    <h1>Letting the <strong>user</strong> control text size</h1>
    <p>Since only the user can know what size text works for him,
    it is <strong>very</strong> important to let him configure the text size.
    …

## Resources

Resources are for information purposes only, no endorsement implied.

- Cascading Style Sheets, Level 2 (CSS2), Fonts

- CSS 2 Font Size Property

- CSS-Discuss Font Size Using Keywords

## Related Techniques

- C12: Using percent for font sizes
- C14: Using em units for font sizes

## Tests

### Procedure

1. Examine all CSS properties that define font size of the CSS rule set.

2. Check that the value is one of `xx-small`, `xx-small`, `x-small`, `small`, `medium`, `large`, `x-large`, `xx-large`, `xsmaller`, or `larger`.

### Expected Results

- Check #2 is true

- Top
- Contents
- Intro
- Previous: Technique C12
- Next: Technique C14