How do I stop a div taking up space?

"Do you know how I can stop it from taking up space when it is made visible?"

Position it absolutely.

div#theParent {
  position:relative;
  height:200px;
  width:640px;
  top:50px;
  left:50px;
}
div#theChild {
  position:absolute;
  height:100px;
  width:400px; 
  top:50px;
  left:120px;
}

<div id="theParent">
  <div id="theChild">
    <p>This div is absolutely positioned to a relatively-positioned parent.</p>
  </div>
</div>

When you want to make it invisible, make it really invisible with style="display:none". There are many ways to do this...not sure how you have this set up or how you're altering your dom elements. Provide some more context (doing this with Ajax controls, custom JavaScript, a library like jQuery, etc), and we can give you a more specific solution.

Tags:

Html

Css