HTML & CSS · Middle · Question 72 of 75

How do you hide a text label visually but keep it for screen readers?

Explanation

display: none and visibility: hidden remove the content from the accessibility tree. Tailwind's sr-only utility implements the clipping pattern.

Further reading

Problem with a question

HTML & CSS · Middle · question 72

Test yourself

Take the HTML & CSS · Middle quiz: questions and options are shuffled, and you get a review of your mistakes at the end.

Take this quiz