I want to add simply a red border across the #cont
but whenever i float these three boxes the border does not work and it only comes on top not wrapping all the div.however i can use overflow:auto. it works but i just wanted to know why it does not work with out overflow.
HTML:
<div id ="cont">
<div class ="box" > box1 </div>
<div class ="box" > box2 </div>
<div class ="box" > box3 </div>
</div>
<div id="foo">footer</div>
CSS:
#cont {
width:950px;
border:1px solid red;
}
.box {
width:300px;
height:100px;
border:1px solid black;
background-color:orange;
float:left;
}
#foo {
width:100px;
background-color:blue;
clear:both;
}