views:

207

answers:

1

How can I get an embedded video to float left in IE7? The following code works great in FireFox and the text wraps around the floated div and video, but in IE7 the text sits under the div/video.

<object height="264" width="320" style="float: left; margin: 5px;"><param name="wmode" value="transparent"><param name="AllowFullScreen" value="true" /><embed type="application/x-shockwave-flash" src="http://somevideo.com/" AllowFullScreen="true" allowScriptAccess="always" height="264" wmode="transparent" width="320"></embed></object>
<p>Lorem ipsum dolor sit amet, consectetur adipiscing elit. Vestibulum auctor sapien vel sem fermentum faucibus. Suspendisse bibendum vulputate dolor non pellentesque. Donec ornare condimentum purus eget fringilla. Ut hendrerit neque vitae velit rhoncus ac pulvinar dui pretium. Morbi rutrum mauris vitae quam ultricies molestie. Cras lorem est, placerat eu dictum ut, faucibus sed neque.</p>
+1  A: 

IE only uses the embed tag, it ignores the object tag.

Put it inside a div element, specify the same size for it, and set the float and margin on the div instead.

Alternatively, add the style both to the object and embed tags, but that might not work well if some browsers use both styles so that you get double margins.

Guffa
Guffa this is killer. Thanks so much for the help and the info about IE only using the embed tag!
Hunter Satterwhite