I want to wrap text around an iframe. How do I do this?

I tried putting the iframe in a div that had a float but that didn’t work, but then, I am not a CSS guru. The thing is that when I write reviews on my website I link to the product at Amazon, and their links come in iframes. I want my text alongside it. How do I go about doing this? Any help? I’m faking it with tables right now but that looks bad if the width of the page gets moved by very much.

(Note, I did Google this and tried a few of the things I found suggested and they didn’t work.)

Treat the iframe itself as a block-level element and put the same style attributes on it as you would a div. Give it a height and a width.

In this example, the iframe is on the right with a text wrap.

<iframe src="http://www.google.com" style="width: 400px; float: right;"></iframe>
<p>Lorem ipsum dolor sit amet, consectetur adipiscing elit. Suspendisse tincidunt, enim a scelerisque facilisis, dolor velit mollis elit, sit amet mollis eros lacus vitae purus. Nullam et tellus velit, ac dapibus eros. Aliquam erat volutpat. Mauris nec dolor dui, at eleifend ante. Etiam auctor facilisis semper. In eget erat at tellus tincidunt laoreet. In ultricies, nunc mattis fermentum condimentum, libero velit accumsan felis, vitae pharetra elit est a turpis. Maecenas convallis tortor rutrum magna imperdiet posuere sit amet sed nunc. In iaculis eleifend iaculis. Pellentesque ut magna eu tellus dictum ultricies at vel tortor. Praesent risus nunc, pulvinar quis dictum eget, posuere vitae neque. Etiam ut ante lacus. Aliquam quis nisl magna. Curabitur vitae felis mauris. Suspendisse vel nisi ante, sit amet venenatis quam. Donec et augue consectetur dolor congue lobortis eu at tellus. Aliquam erat volutpat. Nunc molestie mattis tortor a porta. Cum sociis natoque penatibus et magnis dis parturient montes, nascetur ridiculus mus.</p>

<p>Praesent id felis rhoncus nisl dapibus facilisis. Ut gravida porttitor vehicula. Vivamus laoreet eleifend turpis, et condimentum risus porttitor ut. Duis id dolor quis nunc elementum consequat non nec lorem. Ut ac magna purus, sit amet aliquet lacus. Curabitur ipsum nibh, imperdiet et mollis id, pharetra sed risus. Proin erat enim, lacinia id vehicula vitae, pulvinar a metus. Vestibulum massa tortor, semper ut faucibus eu, faucibus in ligula. Nullam fermentum pulvinar erat sit amet accumsan. Ut aliquam nibh eu lorem sagittis at consequat diam suscipit. Suspendisse potenti. Proin ultrices massa nec lectus fermentum porta. Nunc eget ligula ac ante condimentum fermentum a ut ligula. In pharetra ornare purus, sed aliquet nunc sodales a. Integer sagittis tincidunt dui, ut posuere tortor pulvinar eget. Morbi lobortis, erat in ornare eleifend, purus elit tristique purus, eget tempus augue risus sit amet lacus. Donec lacus purus, ultrices ac tincidunt at, consequat nec diam. Nunc vestibulum elit id urna pellentesque scelerisque. </p>

Thanks! I had added some css to the iframe in question but it was a big long nasty chunk of code (from Amazon) and hadn’t noticed that it already had some css buried inside it, so it ignored my second set. When I added the float to theirs, it worked! Thanks so much :slight_smile: