The visibility property is similar to the display property, but only specifies if an element should be displayed


With the following values assigned to the visibility property:

Value Description
visible Box is visible. Default value
hidden Box is not visible, but still occupies the same space
collapse Only used on table elements 

Removes a row or column, but does not affect layout



Save & refresh browser:

A normal visible heading.

Followed by an invisible hidden heading!

And now some text occupying the space as though the <h2> heading were still there!

Leave a Reply