I would use clearfix , you can find out more about it here
Also, be careful, there is no border-size attribute, what you were trying to do was border-width .
Just my opinion here, these are the best practices for not using inline styles .
So you have a clean solution.
So see below snippet:
.clearfix:before, .clearfix:after { content: ""; display: table; clear: both } div { padding: 1%; border: 1px solid #000; width: 100%; } div > img { float: left; max-width: 30%; max-height: 200px; }
<div class="clearfix"> <img src="http://i.imgur.com/FwgZFNn.jpg" />Here is some text. </div>
source share