Can't make out with clearfix. As planned, the div3 block should not climb onto the floating elements. If I put a separate block with the clear property: both, everything works. If I do it through a pseudo-element (code below), then the backup does not work. Can you indicate where the error is?
<!-- STYLE --> <style> * { margin: 0; padding: 0; } .wrapper { height: 100px; width: 100%; background-color: silver; } .clearfix:after { content: ""; display: table; clear: both; } .div1 { float: left; background-color: rgba(227,27,191,0.5); width: 30%; } .div2 { float: left; background-color: #A8ECFF; width: 40%; } .div3 { width: 30%; height: 180px; background-color: #50D42A; } </style> <!-- CONTENT --> <div class="wrapper clearfix"> <div class="div1">Some text Some text Some text Some text Some text Some text Some text Some text Some text Some text Some text Some text Some text Some text Some text Some text Some text Some text Some text Some text Some text Some text Some text Some text Some text Some text Some text Some text Some text Some text Some text Some text Some text Some text Some text Some text Some text Some text Some text Some text Some text Some text Some text Some text Some text Some text Some text Some text Some text Some text Some text Some text Some text Some text Some text Some text Some text Some text Some text Some text Some text Some text Some text Some text </div> <div class="div2">Text of some Text of some Text of some Text of some Text of some Text of some Text of some Text of some Text of some Text of some Text of some Text of some Text of some Text of some Text of some Text of some Text of some Text of some Text of some Text of some Text of some Text of some Text of some Text of some Text of some Text of some Text of some Text of some Text of some Text of some Text of some Text of some Text of some Text of some Text of some Text of some </div> </div> <div class="div3"></div> Link to code: http://codepen.io/Gaxak/pen/mOvvwZ