Last active
July 18, 2024 18:56
-
-
Save FernandoCutire/58efc2db1e52f5f1703c68ea11075626 to your computer and use it in GitHub Desktop.
Hides an element completely (visually and positionally) in the DOM while still allowing it to be accessible. - Remove all borders and padding and hide the element's overflow.
Use clip to define that no part of the element is shown.
Make the heig
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
.offscreen { | |
border: 0; | |
clip: rect(0 0 0 0); | |
height: 1px; | |
margin: -1px; | |
overflow: hidden; | |
padding: 0; | |
position: absolute; | |
width: 1px; | |
} |
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
<a class="button" href="https://google.com"> | |
Learn More <span class="offscreen"> about pants</span> | |
</a> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment