HTML & CSS · Senior · Question 34 of 75

What is the minimum required for an accessible modal dialog?

Explanation

Keyboard and screen reader users must get into the modal, not "fall out" of it with Tab, close it and return where they were. A native <dialog> with showModal() does most of this: the background becomes inert, Esc closes it, focus moves. You also need a label via aria-labelledby. aria-hidden on the modal would hide it from screen readers instead.

Further reading

Problem with a question

HTML & CSS · Senior · question 34

Test yourself

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

Take this quiz