CSS 3 · Positioning, effects and animation

Hide text visually but keep it for screen readers

Hide an element from view but keep it available to assistive technology.

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
}

Official CSS 3 documentation

More positioning, effects and animation commands

All positioning, effects and animation commands · CSS 3 cheatsheet

Was this page helpful?