# Using percent for font sizes

ID: C12

Technology: css

Type: Technique

## When to Use

CSS

## 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

### 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.

    <style>
      strong {font-size: 120%}
    </style>

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

## 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

## Related Techniques

- C13
- C14

## Resources

- Cascading Style Sheets, Fonts.
- CSS `font-size` property.