CSS visibility property

CSS visibility

CSS visibility is used to hide or show and element.

It can be used without affecting the layout of the document.

This property can also be used to hide or show, rows or columns in a table.

CSS visibility property values are

  • collapse
  • hidden
  • visible

collapse value for css visibility property

The element is made hidden in common, and it affects the layout. If used in a table to hide a row, that particular row will be hidden and the space will occupied by the following row without leaving any space.

Example

Try Yourself

hidden value for css visibility property

The element is made hidden, and it affects the layout. If used in a table to hide a row, that particular row will be hidden and the space will be left empty.

Example

Try Yourself

visible value for css visibility property

The element is made visible.

Example

Try Yourself