I want to create a text that floats left around an image. Next paragraphs should only float around the next image.
<div>
<div style="float: right; padding: 0 0 1em 1em;">
<img src="myImage1.png" .../>
</div>
<p>
This text should float around the...
</p>
<p>
... above myImage1.png.
</p>
</div>
<div style="clear: both;">
<div style="float: right; padding: 0 0 1em 1em;">
<img src="myImage2.png" .../>
</div>
<p>
This text should float around the...
</p>
<p>
... above myImage2.png.
</p>
</div>
I want to avoid having to add style="clear: both;"
on the next div, but want the floating image automatically stop floating at the end of the first top-level </div>
, so each div can have the same style class:
<div class="floatBlock">
...
</div>
<div class="floatBlock">
...
</div>
which especially becomes useful if there are -tags inside (the first floatBlock's image should not float below the h3):
<div class="floatBlock">
...
</div>
<h3>Lorem ipsum</h3>
<div class="floatBlock">
...
</div>
I hope to have described my goal understandable.
How to define the style for floatBlock
so the nested images do not float outside?