SIA-R71Paragraphs of text are not justified

Accessibility requirements

This rule tests conformance of the following accessibility requirements:

Description

This rule checks that paragraphs of text are not justified.

Applicability

This rule applies to every element that has a semantic role of paragraph and is visible.

Expectations

  1. The element does not have a computed text-align of justify.

Assumptions

This rule makes the following assumptions:

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

  • No mechanism is available to left or right align the text.

    If, for stylistic purposes, text justification is desirable, text should instead be either left or right aligned by default and a mechanism provided to justify it.

Accessibility support

This rule has no known accessibility support concerns.

Examples

Passed

This paragraph of text is left aligned and therefore passes the rule:

<style>
    p {
        text-align: left;
    }
</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

This paragraph of text is justified and therefore fails the rule:

<style>
    p {
        text-align: justify;
    }
</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>