Skip to content

QuizNot attempted

aria-hidden vs .sr-only

Match the intent: hide a decorative SVG icon from screen readers, and add "(opens in new tab)" text only for screen readers.
1–4 to choose, Enter to submit
Show answer & explanation

Correct answer:

  • Icon: aria-hidden="true" · Text: a .sr-only visually-hidden class
  • aria-hidden="true" removes the icon from the accessibility tree while it stays visible, and .sr-only (clip + 1px box) hides text visually while keeping it readable.
  • Not the swapped pairing: that would announce the icon and hide the extra text from the people who need it.
  • Not display: none for both: hides from everyone, so the 'opens in new tab' text is never read.
  • Not role=presentation / alt='': those apply to images and semantics, and alt='' on text does nothing.