Hello, I would like you to clarify the following problem. In itself the floating positioning I have it quite understood, but I have been testing the following example.
.contenedor {
width: 500px;
background-color: aqua;
border: 2px solid blue;
overflow: hidden;
}
.hijo1,
.hijo2,
.hijo3 {
width: 200px;
height: 200px;
margin-bottom: 5px;
}
.hijo1 {
background-color: red;
float: left;
}
.hijo2 {
background-color: green;
}
.hijo3 {
background-color: yellow;
}
<div class="contenedor">
<div class="hijo1">
<h1>1</h1>
</div>
<div class="hijo2">
<h1>2</h1>
</div>
<div class="hijo3">
<h1>3</h1>
</div>
<p>Hola como estan gente, espero que muy bien. Saludos</p>
</div>
When the boxes have no content there is no problem, because if I position the first box as floating the second box is placed below it, the thing changes when I add the h1 to make it more indicative and it happens that if, if the second box is placed under the first but NOT in its entirety and above the h1 stays out of it. My question is to what is it? Because the H1 of the second box is not hidden and stays out there if it is inside the box? I hope you can explain me, thank you.