Navigation Menu

Skip to content

Instantly share code, notes, and snippets.

@Asjas
Last active December 8, 2020 20:01
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save Asjas/895df742c419236deb25d48bb2190c35 to your computer and use it in GitHub Desktop.
Save Asjas/895df742c419236deb25d48bb2190c35 to your computer and use it in GitHub Desktop.
A CSS class for screen reader content. This will hide the HTML Element from the user but will still allow screen readers to see it.
// https://hugogiraudel.com/2016/10/13/css-hide-and-seek/
.sr-only {
border: 0 !important;
clip: rect(1px, 1px, 1px, 1px) !important;
-webkit-clip-path: inset(50%) !important;
clip-path: inset(50%) !important;
height: 1px !important;
overflow: hidden !important;
padding: 0 !important;
position: absolute !important;
width: 1px !important;
white-space: nowrap !important;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment