CSS Tutorial



CSS VISIBILITY


CSS visibility Property

The visibility property is used to show or hide an element, but it does not remove the space the element takes on the page.

๐Ÿ”น Common Values:

  • visible โ€“ Default value; the element is visible.
  • hidden โ€“ The element is hidden, but its space is still preserved.

๐Ÿงช Live Example:

Box 2 is hidden using visibility: hidden, but it still takes up space:

Box 1
Box 2
Box 3

๐Ÿ’ก CSS Code:

.box2 {
  visibility: hidden;
}

๐Ÿ“Œ Key Difference (vs display):

  • display: none; hides the element and removes its space.
  • visibility: hidden; hides the element but keeps its space reserved.

๐ŸŒŸ Enjoyed Learning with Us?

Help others discover Technorank Learning by sharing your honest experience.
Your support inspires us to keep building!

Leave a Google Review