SyntaxStudy
Sign Up
Home CSS Reference visibility

visibility

property

Shows or hides an element without removing it from the document flow (unlike display: none).

Syntax

visibility: visible | hidden | collapse;

Example

css
.visible { visibility: visible; }  /* default */
.hidden  { visibility: hidden; }   /* invisible, still takes up space */

/* vs display: none */
.display-none {
    display: none;       /* removed from flow */
}
.visibility-hidden {
    visibility: hidden;  /* space preserved */
}