Last active
January 25, 2024 23:32
-
-
Save henshaw/9f08e1ec5e1ce6cbe902e9b1a353b40b to your computer and use it in GitHub Desktop.
CSS for hiding the WordPress Search Form Label while maintaining accessiblity (not using display:none;)
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
.screen-reader-text:not(:focus):not(:active) { | |
position: absolute; | |
overflow: hidden; | |
clip: rect(0 0 0 0); | |
clip-path: inset(50%); | |
width: 1px; | |
height: 1px; | |
white-space:nowrap; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment