CARVIEW |
C21: Specifying line spacing in CSS
Important Information about Techniques
See Understanding Techniques for WCAG Success Criteria for important information about the usage of these informative techniques and how they relate to the normative WCAG 2.0 success criteria. The Applicability section explains the scope of the technique, and the presence of techniques for a specific technology does not imply that the technology can be used in all situations to create content that meets WCAG 2.0.
Applicability
All technologies that support CSS
This technique relates to:
Description
Many people with cognitive disabilities have trouble tracking lines of text when a block of text is single spaced. Providing spacing between 1.5 to 2 allows them to start a new line more easily once they have finished the previous one.
Examples
Example 1
Setting the element to 1.5 line height. In the style sheet set the characteristics of the element.
Example Code:
p { line-height: 150%; }
In the content the element will now be 1.5 line height, throughout the document.
Example Code:
<p> Lorem ipsum dolor sit … </p>
Example 2
Setting a class to 1.5 line height (space-and-a-half line spacing). In the stylesheet, define the class.
Example Code:
p.tall {line-height:150%}
In the content, call up the class = "left".
Example Code:
<p class="tall"> Lorem ipsum dolor sit … </p>
Example 3
Setting a class to double-spaced line height. In the stylesheet, define the class.
Example Code:
p.tall {line-height:200%}
In the content, call up the class = "right".
Example Code:
<p class="tall"> Lorem ipsum dolor sit … </p>
Tests
Procedure
Open content in a browser.
Check that the spacing between lines in blocks of text is between 1.5 and 2.
Expected Results
Test Procedure #2 is true.
If this is a sufficient technique for a success criterion, failing this test procedure does not necessarily mean that the success criterion has not been satisfied in some other way, only that this technique has not been successfully implemented and can not be used to claim conformance.
This Web page is part of Techniques and Failures for Web Content Accessibility Guidelines 2.0 (see the latest version of this document). The entire document is also available as a single HTML file. See the The WCAG 2.0 Documents for an explanation of how this document fits in with other Web Content Accessibility Guidelines (WCAG) 2.0 documents. To send public comments, please follow the Instructions for Commenting on WCAG 2.0 Documents.
Copyright © 2016 W3C® (MIT, ERCIM, Keio, Beihang). W3C liability, trademark and document use rules apply.