Home - Priority 1 Index - Priority 2 Index - Priority 3 Index - Accesskeys - Accessibility Validators - Contact

Web Content Accessibility Guidelines

2.1

Priority 2 Item 3

Use relative rather than absolute units of measure (e.g., for margins, font sizes, borders, etc.).

The relative unit

Wildlife Benefits

<p style="font-size:2.5em;color:#060;text-align:center;">Wildlife Benefits</p>

Why relative?

The use of relative size and position units is important for two broad reasons: web content should be able to flow into differently-sized viewing areas, and users may need to change the size of all text on a page.

When using style sheets, it is best to use percent, "em", or "ex" values. All other values are fixed in size. When setting a base size for the web, you should avoid using pixels or points. Defining your base font size as "100%" will allow it to be the user's preferred size. All other sizes will be relative to the base font size. Normally, for non-typographic elements, such as layers, you should use percent units.

As an example, this site sets the base font size to 62.5% (which calculates to 10px). This gives you an easy way to calculate the size of of all other fonts on the page.

body { font-size: 62.5%;  /* 16px × 62.5% = 10px */ }  
h1 { font-size: 2em; /* 10px × 2em = 20px */ }  
p { font-size: 1.2em; /* 10px × 1.2em = 12px */ }

More Resources

Units of measure - CSS Techniques for Web Content Accessibility Guidelines 1.0.

View WAI Checkpoint 3.4 - Use relative rather than absolute units in markup language attribute values and style sheet property values.