HTML & CSS · Middle · Question 40 of 75

When is aria-label justified?

Explanation

aria-label sets an element's accessible name when there's no visible label: <button aria-label="Close">✕</button>. The first rule of ARIA is not to use it when a native option exists: alt for images, <label> for fields. aria-label doesn't affect SEO, and an unnecessary one can override clear visible text.

Further reading

Problem with a question

HTML & CSS · Middle · question 40

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