Classes Available in Screen Reader Utility:
1.sr-only: This class hides an element in all devices except for the Screen Readers.
2.sr-only-focusable: If this class is used on an hidden element with .sr-only class, then the element will be visible when focused by any thing like keyboard.
Below examples explains the Screen Reader utilities in Bootstrap:
Let us create a Heading element with .sr-only class:
Example-1
<!DOCTYPE html> <html> <head> <title>screen reader</title> <script src="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/js/bootstrap.min.js" ></script> <link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/css/bootstrap.min.css"/> </head> <body> <h1 class="sr-only">BAJARANGI SOFT</h1> </body> </html>
class="sr-only sr-only-focusable"
<!DOCTYPE html> <html> <head> <title>screen reader</title> <script src="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/js/bootstrap.min.js" ></script> <link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/css/bootstrap.min.css"/> </head> <body> <a class="sr-only sr-only-focusable" href="#content"> Skip to main content </a> </body> </html>