The idea
display: none removes an element from layout completely — it takes up no space, and everything after it slides up to fill the gap. This is different from visibility: hidden, which hides the element but leaves an empty hole where it was.
visibility is off-limits: hiding the box without removing it would leave the gap in place.