I'm failing to understand why overflow: hidden
solve my floating problem: I don't want the words to be inside the picture in the left.
I also read Understanding CSS Layout And The Block Formatting Context.
The example is taken from https://internetingishard.com/html-and-css/floats/ but lacks the explanation of why.
.column {
overflow: hidden;
float: left;
width: 31%;
margin: 20px 1.15%;
height: 160px;
background-color: #B2D6FF;
/* Medium blue */
}
.avatar {
float: left;
width: 60px;
height: 60px;
margin: 25px;
border-radius: 40px;
background-color: #D6E9FE;
}
.username {
margin-top: 30px;
}
.comment {
margin: 10px;
overflow: hidden;
/* This is important */
}
<div class='column'>
<div class='avatar'></div>
<h3 class='username'>Bob Smith</h3>
<p class='comment'>Aptent vel egestas vestibulum aliquam ullamcorper volutpat</p>
</div>