visibility PropertyThe visibility property is used to show or hide an element, but it does not remove the space the element takes on the page.
Box 2 is hidden using visibility: hidden, but it still takes up space:
.box2 {
visibility: hidden;
}
display):display: none; hides the element and removes its space.visibility: hidden; hides the element but keeps its space reserved.Help others discover Technorank Learning by sharing your honest experience.
Your support inspires us to keep building!