Skip to content
Search

Tailwind:ScreenReaders

lastmod 2024-03-19created 2024-03-191 edits

How to apply a Screen reader in Tailwind.

sr-only

position: absolute;
width: 1px;
height: 1px;
padding: 0;
margin: -1px;
overflow: hidden;
clip: rect(0, 0, 0, 0);
white-space: nowrap;
border-width: 0;

Used to hide an element visually without hiding it from ScreenReaders.

<a href="#">
  <svg><!-- ... --></svg>
  <span class="sr-only">Settings</span>
</a>

not-sr-only

position: static;
width: auto;
height: auto;
padding: 0;
margin: 0;
overflow: visible;
clip: auto;
white-space: normal;

See also

Favorite site

author Zer0 sitemap