I am dealing with a layout issue where headlines should be displayed next to floated images if there is enough space, and drop below the images if not. Unfortunately, I do not have access to the HTML code, so I need to solve this problem purely through CSS. Below is an example of the image and headline HTML I receive, along with how it appears on an iPhone:
<p>
<img src="http://farm3.staticflickr.com2852/1232.jpg" style="height:265px; width:350px; float: right;"/>
</p>
<h3>THE HEADLINE</h3>
I have managed to address wrapping <p>
content around an image using a specific trick that sets a minimum width for each paragraph. This involves creating a fixed-width element before each paragraph to act as the minimum width:
p:before { content: ""; width: 10em; display: block; overflow: hidden; }
However, this method does not work for a header. Do you have any suggestions on how to handle this?