Skip to content

Instantly share code, notes, and snippets.

@seantunwin
Last active August 14, 2023 19:06
Show Gist options
  • Save seantunwin/c7f1d59272d1662d8fa8a43578c29c26 to your computer and use it in GitHub Desktop.
Save seantunwin/c7f1d59272d1662d8fa8a43578c29c26 to your computer and use it in GitHub Desktop.
/* https://github.com/LinkedInLearning/simplifying-web-development-with-accessibility-best-practices-2883015 */
.sr-only {
clip: rect(1px, 1px, 1px, 1px);
clip-path: inset(50%);
height: 1px;
width: 1px;
margin: -1px;
overflow: hidden;
padding: 0;
position: absolute;
}
img {
display: block;
vertical-align: middle;
max-with: 100%;
height: auto
}
/* Make the whole card clickable. */
/* Prevents text highlighting. */
.card a::after {
position: absolute;
top: 0;
left: 0;
content: "";
display: block;
width: 100%;
height: 100%;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment