Last active
February 9, 2025 17:16
-
-
Save demoive/4648979 to your computer and use it in GitHub Desktop.
Snippet - CSS Hide text
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| .hide-text { | |
| display: block; | |
| white-space: nowrap; | |
| text-indent: 100%; | |
| overflow: hidden; | |
| } | |
| .hide { | |
| position: absolute; | |
| clip: rect(1px, 1px, 1px, 1px); | |
| // only needed for an apparent bug in Webkit/Opera | |
| // http://snook.ca/archives/html_and_css/hiding-content-for-accessibility | |
| height: 1px; | |
| width: 1px; | |
| overflow: hidden; | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment