concept

Visually hidden — CSS reference

A visually hidden utility can keep meaningful text available for accessible naming while preventing it from occupying visible layout. Do not hide interactive controls this way unless they become visible when focused, as with a skip link. This button has a hidden text label and a decorative icon excluded from accessibility naming.

Formal Syntax & Structure

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

Working Example

Example Snippetcss
<!doctype html><html lang="en"><meta charset="utf-8"><title>visually-hidden</title><style>body{margin:8px;font:16px/1.5 sans-serif;color:black;background:white}#a{box-sizing:border-box}.sr-only{position:absolute;width:1px;height:1px;clip-path:inset(50%);overflow:hidden;white-space:nowrap}</style><body><button><span aria-hidden="true">⌕</span><span id="a" class="sr-only">Search</span></button></body></html>
CSS Reference