Skip to content

Latest commit

 

History

History
35 lines (26 loc) · 563 Bytes

hidden-elements.md

File metadata and controls

35 lines (26 loc) · 563 Bytes

Hidden elements

Hide an element

<div hidden>Hidden content</div>

Hide only from assistive tecnology

<div aria-hidden="true">Hidden content</div>

Hide only visually

.visually-hidden:not(:focus):not(:active) {
  clip: rect(0 0 0 0); 
  clip-path: inset(50%);
  height: 1px;
  overflow: hidden;
  position: absolute;
  white-space: nowrap; 
  width: 1px;
}
<div class="visually-hidden">Hidden content</div>

Inclusively Hidden