I have three block elements, three div but the first is a float element thereby the float element will behave as if it didn't exist, thus the second div overlap the float element but the textual content of the box (the second div) retams some memory of the floated element and should be shortened to make room for the floated element instead this does not happen. In fact the text wraps and the second box is superimposed to first float box. I don't understand the reason for this behavior
.box {
border: thick solid red;
width: 400px;
height: 400px;
background-color: yellow;
}
.box:first-child {
float: left;
}
<!-- Essendoci sovrapposizione tra il primo e il secondo div ed anche opacita
il primo div(sovrapposto al secondo) appare di un colore diverso del terzo.
-->
<div class="box">
First element
</div>
<div class="box">
Second element
</div>
<div class="box">
Third element
</div>