<p class="box1">This paragraph has a span <span class="ib">with padding</span> and has inline flow-root. Therefore the padding will push away other lines of text.</p>
<div class="box box2">
<img src="https://s3-us-west-2.amazonaws.com/s.cdpn.io/12005/balloon-sq1.jpg" alt=""> The image has been floated to the left. This box does have display: flow-root.
</div>
<p>This paragraph follows the box which contains the float.</p>
span {
background-color: rgba(0,0,0,.4);
color: #fff;
padding: 10px;
display: inline flow-root;
}
.box {
clear: left;
background-color: #333;
color: #fff;
max-width: 500px;
margin: 0 0 2em 0;
padding: 1em;
display: block flow-root;
}
p {
margin: 2em 0;
width: 400px;
}
.box img {
float: left;
width: 150px;
margin: 0 10px 10px 0;
}
body {
padding: 1em;
font: 1.2em/1.4 Arial, Helvetica, sans-serif;
}
This Pen doesn't use any external CSS resources.
This Pen doesn't use any external JavaScript resources.