Dev Helpers
← Back

Visually hide an accessible label

Visually hide an accessible label with native CSS. The preview includes a small shared demo stylesheet.

Open this example in the interactive library

Source code

<style>
  .demo {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
  }
</style>
<label
  ><span class="demo">Search articles</span
  ><input type="search" placeholder="Search"
/></label>