Don’t use the CSS text-indent to hide text
Description
This rule determines if there is a defined style text-indent
with the value so that the element is being positioned out of the viewport.
Context
The technique, e.g., text-indent: -10000px
, is still being used to hide the content visually. However, the downside of that technique is that the screen reader focus follows that, and it gets out of the visible area.
The rule passes when there is no defined style text-indent
that hides the content outside of the viewport.
Hot to fix it
Use a technique that hides the content visually, but does not move the element outside of the visible viewport. See example from Bootstrap.
Rule
- Audit: Accessibility.
- Standard: SiteLint.
- Level: Best Practices.
- Success Criteria: Not applicable
- ID:
incorrect-technique-for-hiding-content