Skip to content

Instantly share code, notes, and snippets.

@d4rkr00t
Created September 4, 2014 06:13
Show Gist options
  • Save d4rkr00t/80eb8b02c27ea29331af to your computer and use it in GitHub Desktop.
Save d4rkr00t/80eb8b02c27ea29331af to your computer and use it in GitHub Desktop.
The hidden-accessible class has the unique ability to mimic the effects of display: none, yet still be accessible to screen readers and possess the correct metrics. This is useful for retrieving the width and height of an element in JavaScript without it being visible or taking space in the layout.
.hidden-accessible {
border: 0;
clip: rect(0 0 0 0);
height: 1px;
margin: -1px;
overflow: hidden;
padding: 0;
position: absolute;
width: 1px;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment