The visibility
property designates whether or not an element is visible in the browser.
Although elements with the visibility property set to hidden are not visible, their space is still taken up on the page.
h2.hide {
visiblity: hidden;
}
h2.show {
visibility: visible;
}
visible
Default value. Sets the element to be visible.
hidden
Sets the element to be hidden (but still takes up space).
collapse
Used only for <tr>
, <rowgroup>
, <col>
, or <colgroup>
within a <table>
, in which the element is hidden and the space is collapsed. When used on other elements they act the same as hidden
.
initial
Sets the property to its default value.
inherit
Inherits this property’s value from its parent item.
Have a code example of visibility
? Submit a codepen.io demo and we'll showcase it here ↴