mirror of
https://github.com/twbs/bootstrap.git
synced 2024-12-02 14:24:19 +01:00
10690dd317
* Rename `sr-only`/`sr-only-focusable` To be more representative of the fact that these are not necessarily "screen reader" specific, but actually apply to assistive technologies in general (and also things like Alexa/Siri/etc). Goes hand-in-hand with #31133 Co-authored-by: XhmikosR <xhmikosr@gmail.com>
26 lines
722 B
Markdown
26 lines
722 B
Markdown
---
|
|
layout: docs
|
|
title: Screen readers
|
|
description: Use screen reader utilities to hide elements on all devices except screen readers.
|
|
group: helpers
|
|
---
|
|
|
|
Hide an element to all devices **except screen readers** with `.visually-hidden`. Use `.visually-hidden-focusable` to show the element only when it's focused (e.g. by a keyboard-only user). Can also be used as mixins.
|
|
|
|
{{< example >}}
|
|
<h2 class="visually-hidden">Title for screen readers</h2>
|
|
<a class="visually-hidden-focusable" href="#content">Skip to main content</a>
|
|
{{< /example >}}
|
|
|
|
{{< highlight scss >}}
|
|
// Usage as a mixin
|
|
|
|
.visually-hidden-title {
|
|
@include visually-hidden;
|
|
}
|
|
|
|
.skip-navigation {
|
|
@include visually-hidden-focusable;
|
|
}
|
|
{{< /highlight >}}
|