HTML & CSS · Junior · Question 18 of 75

How does display: none differ from visibility: hidden?

Explanation

With display: none the element isn't rendered and takes no space - neighbors shift. With visibility: hidden it's invisible but its space remains. opacity: 0 also keeps the space, and the element stays clickable. None of these remove the element from the DOM, and screen readers ignore only the first two.

Further reading

Problem with a question

HTML & CSS · Junior · question 18

Test yourself

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

Take this quiz