Intermediate
HTML & CSS
Q58 / 100
What is the difference between "visibility: hidden" and "display: none"?
Correct! Well done.
Incorrect.
The correct answer is B) "visibility: hidden" hides the element but it still occupies its layout space, while "display: none" removes it entirely from the layout, taking up no space
B
Correct Answer
"visibility: hidden" hides the element but it still occupies its layout space, while "display: none" removes it entirely from the layout, taking up no space
Explanation
visibility: hidden leaves a gap where the element would be (it's invisible but still takes up space), whereas display: none collapses the element entirely as if it weren't there.
Progress
58/100