I can understand this code.
.container {
border: 2px solid black;
}
.float {
border: 2px solid red;
float: left;
}
<!DOCTYPE html>
<html>
<body>
<div class="container">
<div class="float">i am float</div>
</div>
</body>
</html>
But when overflow hidden is applied to container element why does not floated element gets hidden like it should according to description of overflow:hidden;
. Rather the container element wraps itself around floated element. Cam u explain this ?
.container {
border: 2px solid black;
overflow: hidden;
}
.float {
border: 2px solid red;
float: left;
}
<!DOCTYPE html>
<html>
<body>
<div class="container">
<div class="float">i am float</div>
</div>
</body>
</html>