[html] How to force div to appear below not next to another?

I would like to place my div below the list, but actually it is placed next to the list.The list is generated dynamically, so it doesn't have a fixed hight. I would like to have the map div on the right, and on the left (next to the map) the list placed on top and the second div below the list(but still on the right to the map)

_x000D_
_x000D_
#map { float:left; width:700px; height:500px; }_x000D_
#list { float:left; width:200px; background:#eee; list-style:none; padding:0; }_x000D_
#similar { float:left; width:200px; background:#000; } 
_x000D_
<div id="map">Lorem Ipsum</div>        _x000D_
<ul id="list"><li>Dolor</li></li>Sit</li><li>Amet</li></ul>_x000D_
<div id ="similar">_x000D_
    this text should be below, not next to ul._x000D_
</div>
_x000D_
_x000D_
_x000D_

Any ideas?

This question is related to html css

The answer is


#similar { 
float:left; 
width:200px; 
background:#000; 
clear:both;
}

what u can also do i place an extra "dummy" div before your last div.

Make it 1 px heigh and the width as much needed to cover the container div/body

This will make the last div appear under it, starting from the left.


#map {
  float: right;
  width: 700px;
  height: 500px;
}
#list {
  float:left;
  width:200px;
  background: #eee;
  list-style: none;
  padding: 0;
}
#similar {
  float: left;
  clear: left;
  width: 200px;
  background: #000;
}

Float the #list and #similar the right and add clear: right; to #similar

Like so:

#map { float:left; width:700px; height:500px; }
#list { float:right; width:200px; background:#eee; list-style:none; padding:0; }
#similar { float:right; width:200px; background:#000; clear:right; } 


<div id="map"></div>        
<ul id="list"></ul>
<div id="similar">this text should be below, not next to ul.</div>

You might need a wrapper(div) around all of them though that's the same width of the left and right element.


use clear:left; or clear:both in your css.

#map { float:left; width:700px; height:500px; }
 #list { float:left; width:200px; background:#eee; list-style:none; padding:0; }
 #similar { float:left; width:200px; background:#000; clear:both; } 


<div id="map"></div>        
<ul id="list"></ul>
<div id ="similar">
 this text should be below, not next to ul.
</div>