SIA-R80Paragraphs of text do not have line heights defined in absolute units

Accessibility requirements

This rule tests conformance of the following accessibility requirements:

Description

This rule checks that paragraphs of text do not have line heights that are defined as absolute lengths.

Applicability

This rule applies to every element with a semantic role of paragraph, visible textual content and a cascaded line-height property.

Expectations

  1. The element does not have a cascaded line-height property that is specified as an absolute length.

Assumptions

This rule makes the following assumptions:

  • Elements with a role of paragraph are used for blocks of text.

  • No mechanism is available to change the line height of the text.

Accessibility support

This rule has no known accessibility support concerns.

Examples

Passed

The line height of this paragraph is specified using a relative unit and therefore passes the rule:

<style>
    p {
        line-height: 1.5em;
    }
</style>

<p>
    Lorem ipsum dolor sit amet, consectetur adipiscing elit. Maecenas nec diam
    ullamcorper, cursus nulla non, congue purus. Cras vehicula risus lacus, ac
    placerat diam vestibulum a. Maecenas lobortis enim interdum nisl vehicula
    eleifend. Sed et velit nulla.
</p>

Failed

The line height of this paragraph is specified using an absolute unit and therefore fails the rule:

<style>
    p {
        line-height: 15px;
    }
</style>

<p>
    Lorem ipsum dolor sit amet, consectetur adipiscing elit. Maecenas nec diam
    ullamcorper, cursus nulla non, congue purus. Cras vehicula risus lacus, ac
    placerat diam vestibulum a. Maecenas lobortis enim interdum nisl vehicula
    eleifend. Sed et velit nulla.
</p>

Inapplicable

This paragraph of text is hidden and is therefore inapplicable:

<p hidden>
    Lorem ipsum dolor sit amet, consectetur adipiscing elit. Maecenas nec diam
    ullamcorper, cursus nulla non, congue purus. Cras vehicula risus lacus, ac
    placerat diam vestibulum a. Maecenas lobortis enim interdum nisl vehicula
    eleifend. Sed et velit nulla.
</p>