.sr-only - Hides an element on all devices except for screen readers - HTML CSS Bootstrap Class List

HTML CSS examples for Bootstrap Class List:sr-only

Introduction

The .sr-only class hides an element to all devices except screen readers

You can combine .sr-only with .sr-only-focusable to show the element again when it is focused.</p>

Demo Code

ResultView the demo in separate window

<!DOCTYPE html>
<html>
<head>
  <meta name="viewport" content="width=device-width, initial-scale=1">
  <link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/css/bootstrap.min.css">
  <script src="https://ajax.googleapis.com/ajax/libs/jquery/3.2.1/jquery.min.js"></script>
  <script src="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/js/bootstrap.min.js"></script>
</head><!--   w w w.j ava 2s  .c om-->
<body>

<div class="container">
  <h2>Example</h2>
  <a class="sr-only" href="#">Skip to main content</a>
  <a class="sr-only sr-only-focusable" href="#">Skip to main content</a>
</div>

</body>
</html>

Related Tutorials