The opposite of
visibility: hidden is
visibility: visible. Similarly, is there any opposite for
Many people become confused figuring out how to show an element when it has
display: none, since it’s not as clear as using the
I could just use
visibility: hidden instead of
display: none, but it does not give the same effect, so I am not going with it.
display: none doesn’t have a literal opposite like
visibility property decides whether an element is visible or not. It therefore has two states (
hidden), which are opposite to each other.
display property, however, decides what layout rules an element will follow. There are several different kinds of rules for how elements will lay themselves out in CSS, so there are several different values (
inline-block etc — see the documentation for these values here ).
display:none removes an element from the page layout entirely, as if it wasn’t there.
All other values for
display cause the element to be a part of the page, so in a sense they’re all opposite to
But there isn’t one value that’s the direct converse of
display:none – just like there’s no one hair style that’s the opposite of “bald”.
Answered By – Paul D. Waite