Just use clear: both;
on the 3rd element, this way you don't have to use <div style="clear: both;"></div>
after the floated elements.
.child:nth-child(3) {
background: blue;
color: white;
clear: both;
}
Also, if whenever you are looking to clear a parent element without adding an extra element or using overflow: hidden;
which is a dirty way to clear
floats, you can call a class
on the parent element, with the properties below
.clear:after {
content: "";
display: table;
clear: both;
}
For example
<div class="wrapper clear">
<div class="left_floated_div"></div>
<div class="right_floated_div"></div>
</div>