The visibility property specifies whether an element's content is visible or not. Its values can be visible, hidden, collapse, and inherit. The default value is inherit. If visibility is set to visible, the element displays normally. If visibility is set to hidden, the element's content is hidden (but transparent), but the element still takes up the same location of its generated box. If visibility is set to collapse and the element is not a row or column, according to the CSS2 specification, collapse should have the same meaning as hidden. Firefox does this correctly, but IE6 and IE7 do not treat collapse as hidden.

An important consideration is a comparison of visibility set to hidden and display set to none. If display is set to none, the element's box generation is prevented, so this removes this element from the page rendering. This is different from visibility set to hidden, in which the element content is simply made transparent, but the elements box generation still appears in the page rendering.

The style-test.html file below shows several examples of setting the visibility property and the display property.