I'm facing problem with floating elements inside div only , here is the problem:
.main{
border-style:solid;
border-color:yellow;
overflow:auto;
}
.first {
width:200px;
height:100px;
float: left;
border: 10px solid green;
}
.second {
width:200px;
height: 50px;
border: 10px solid blue;
}
<div class="main">
<div class="first">test1</div>
<div class="second" >test2</div>
</div>
See Question&Answers more detail:os