I have a div with ID "containter" which contain 3 div with floated left property. When I use these floated div, the "container" div don't get height based on insided Div. What is the solution? Thank.
Asked
Active
Viewed 37 times
-1
-
Try to set `overflow:hidden` on the container element. – Cyclonecode Feb 07 '14 at 09:35
1 Answers
0
Put clear property to restore the flow. My Codepen
HTML
<div id="container">
<div class="coucou" ></div>
<div class="coucou" ></div>
<div class="coucou" ></div>
<div class="clear"></div>
</div>
CSS
#container{
width : 600px;
background:pink;
}
.coucou {
margin-left:2px;
width :100px;
height:200px;
float: left;
background:blue;
}
.clear {clear:both;}

ColoO
- 813
- 5
- 14