Jump to content

how do you keep a div from collapsing?


niche

Recommended Posts

I have a div that 200px wide. how do you keep it from collapsing, and be invisible, without having to put something in it?

Link to comment
Share on other sites

I have a div that 200px wide. how do you keep it from collapsing, and be invisible, without having to put something in it?
Collapsing? An empty element with a height of auto (and no padding or other properties, etc) will always seem invisible (the height will be computed as 0). I'm guessing that's what you're talking about."height: 100px;" or "min-height: 100px;"
Link to comment
Share on other sites

I have a right and left div each has min-width:300px;. Between them is a center div defined by: <div style="text-align:center;overflow:hidden;">.the center div is centered if the right and left divs are empty of if they both contain something. However, if the the right div is empty and left one has something in it ( or the right one is empty and the left one has something, the empty div collapses. How do I keep it from collapsing when it's empty?As in:

<div style="width:890px; margin: 0 auto;">    <div id="ldiv2">       <div style="float:right;display:inline;"> here </div>      </div>    <div id="rdiv2">    </div>  <div style="text-align:center;overflow:hidden;">      <h3 style="width:195px; margin: 0 auto;margin-top:10px;margin-bottom:40px;">join here for best prices</h3>      <form name="input" action="parse_join.php" method="post">          <div id="div1"><input id="input1" name="fn" type="text" value="your firstname goes here" onfocus="this.value='';" /></div>      </form>   </div></div>

Link to comment
Share on other sites

I have a right and left div each has min-width:300px;. Between them is a center div defined by: <div style="text-align:center;overflow:hidden;">.the center div is centered if the right and left divs are empty of if they both contain something. However, if the the right div is empty and left one has something in it ( or the right one is empty and the left one has something, the empty div collapses. How do I keep it from collapsing when it's empty?
Like I said, "min-height: 100px;". It sounds like you already give it a width.
Link to comment
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...