!important line height in
style attribute is wide enough
This rule tests conformance of the following accessibility requirements:
This rule applies to every element in the HTML namespace with a visible text node child and whose text includes a soft wrap break, when all the following are true for the
line-height property of the element:
- The used value of the
line-heightproperty of the target element is at least 1.5 times the computed value of its
This rule makes the following assumption:
There is no mechanism available on the page to adjust
The font size is constant for all text node children of the element. If
font-sizechanges (e.g., through use of the
::first-linepseudo-element) then the required line height would also change throughout the element.
The target text nodes children express something in a human language written in a script that that uses the
While some assistive technologies are able to set user origin or user agent origin styles, others, such as browser extensions, are only able to set styles with the author origin. Such assistive technologies cannot create styles "winning" the cascade sort over a
style attribute with an important declaration. If accessibility support does not include assistive technologies that override
line-height through author origin, this rule should not be used.
The implementation of this rule in Alfa has the following additional choices:
<p style="line-height: 2em !important; max-width: 200px;"> The quick brown fox jumps over the lazy dog. </p>
<div style="font-size: 16px; line-height: 15px !important"> <p style="font-size: 10px; max-width: 100px;"> The quick brown fox jumps over the lazy dog. </p> </div>
<p style="line-height: 1em !important; max-width: 200px;"> The quick brown fox jumps over the lazy dog. </p>
<div style="letter-spacing: 0.1em !important;"></div>
<p style="line-height: 1.2em; max-width: 200px;"> The quick brown fox jumps over the lazy dog. </p>
This document includes material copied from or derived from https://www.w3.org/WAI/standards-guidelines/act/rules/78fd32/. Copyright © 2023 W3C® (MIT, ERCIM, Keio, Beihang).