03 September 2009

Floating IFRAMEs in Blogger

In my other blog, I wanted to show images to one side of the text, like this:

XXXXXX +--------+
XXXXXX | iframe |
XXXXXX +--------+
XXXXXX
XXXXXXXXXXXXXXXXX
XXXXXXXXXXXXXXXXX

The images, generated by Amazon, are within an iframe element. After some false starts, I found that the simplest solution was to wrap the iframe elements in a div element, and float the div:

<div style="float:right">
<iframe>
...
</iframe>
</div>
<p>
...
</p>