Skip to content

Instantly share code, notes, and snippets.

@verpixelt
Created November 10, 2017 15:43
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 verpixelt/08ef43135dde10fbe9b1e2e0d3ed8e26 to your computer and use it in GitHub Desktop.
Save verpixelt/08ef43135dde10fbe9b1e2e0d3ed8e26 to your computer and use it in GitHub Desktop.
.visually-hidden {
/* Remove the item from normal flow */
position: absolute;
/* Workaround for falsely pronounced, smushed text */
white-space: nowrap;
/* Set it to the smallest possible size (some screen readers ignore elements with zero height and width) */
width: 1px;
height: 1px;
/* Hide overflowing content after resizing */
overflow: hidden;
/* Reset any property that may change the elements size */
border: 0;
padding: 0;
/* Clipping defines what part of an element should be displayed. */
/* Deprecated clip property for older browsers */
clip: rect(0 0 0 0);
/* clip-path for newer browsers. inset(50%) defines an inset rectangle that makes the content disappear. */
clip-path: inset(50%);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment