tags:

views:

71

answers:

2

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;}?

+7  A: 
visibility:hidden;

This will hide the element from the page but retain it's place in the layout.

Jamie Dixon
A: 

use document.getElementById("my").style.display = "none"; do not user visibility it only hide element but in display it remove the space acquired by element.

Parth
OP wants to preserve the space it occupies
David Caunt