Below is the difference between display:none and visibility:hidden in CSS
display:none:
It is used to hide an element. As it do not occupy any space when hiding an element. In other words, it means that the element hidden is not considered as the DOM element.
Example
h1.hidden {
display: none;
}
visibility:hidden:
It is also used to hide an element as same a display:none does but the deference between display:none and visibility:hidden is that the hidden tag is not visible here but it occupy the space for this HTML element.
Example
h1.hidden {
visibility: hidden;
}
0 Comment(s)