Skip to content

Instantly share code, notes, and snippets.

@kelsS
Created July 26, 2022 16:09
Show Gist options
  • Save kelsS/90b622dc003f76e74f730b99a1d17b2e to your computer and use it in GitHub Desktop.
Save kelsS/90b622dc003f76e74f730b99a1d17b2e to your computer and use it in GitHub Desktop.
visually-hidden class using the clip method in CSS. This allows you to place screen reader only text in the DOM. Resource: https://www.a11yproject.com/posts/how-to-hide-content/
.visually-hidden {
    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