avoid-inline-spacing
Inline text spacing must be adjustable with custom stylesheets.
Description
The purpose of this rule is to allow individuals to customize text spacing for better readability. It is recommended to avoid using inline styling for text spacing. If it is necessary, the !important
flag should not be used to ensure it can be overridden. The following guidelines should be followed:
- Line height (line spacing) should be at least 1.5 times the font size.
- Spacing following paragraphs should be at least 2 times the font size.
- Letter spacing (tracking) should be at least 0.12 times the font size.
- Word spacing should be at least 0.16 times the font size.
Why is it important?
Spacing text at 1.5 to 2 times the regular line height helps individuals with cognitive disabilities track lines of text more effectively, allowing for easier transition to the next line after finishing the previous one.
Examples
-
Success:
-
!important
is not used in any inlnie CSS style.
-
-
Failure:
-
word-spacing
style using!important
is applied on a<p>
element.
-
How to fix?
Eliminate any instance of the !important
declaration used in inline styling that adjusts text spacing.
Tags
cat.structure, wcag21aa, wcag1412
References
- WCAG 1.4.12: Text Spacing
- Deque University: avoid-inline-spacing
- Accessibility Insights: avoid-inline-spacing
- Evinced Digital Accessibility Knowledge Base: avoid-inline-spacing
We're sorry to hear that. Please share your feedback so we can do better
Contact our Support team for immediate help while we work on improving our docs.
We're continuously improving our docs. We'd love to know what you liked
We're sorry to hear that. Please share your feedback so we can do better
Contact our Support team for immediate help while we work on improving our docs.
We're continuously improving our docs. We'd love to know what you liked
Thank you for your valuable feedback!