I need a CSS snippet for hiding a HTML <div class="my">
(with quite a lot of contents, including text and other divs), but still reserving space for it. Is there something better or faster than div.my{opacity:0;}
?
You can hide an element in CSS using the CSS properties display: none or visibility: hidden . display: none removes the entire element from the page and mat affect the layout of the page.
you can wrap another div around the outside of it, and probably tell it a specific height to occupy. that way your inner div can show and hide and fadeOut, etc, and the outer div will hold down the real-estate on the page.
visibility: hidden
This will hide the element from the page but retain its place in the layout.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With