user1272372
user1272372

Reputation: 90

How to position my embedded flash file

I am making sure that my site displays properly on different screen resolutions. Everything is fine except the flash; it is located in the perfect position in 1024 wide resolution but not for wider screens. How can I get it to show in the same place?

This is my css:

#flash {
   margin-top: 30px;
   width: 960px;
   height: 331px;
   margin-bottom: 20px;
   z-index: 0;
}

This is the code I used to embed the file:

<p> </p>
<p>
<object id="flash" style="width: 950px; height: 350px;" classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" width="950" height="360" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,0,0" align="centre">
<param name="movie" value="/media/flash_final.swf" />
<param name="quality" value="high" />
<param name="wmode" value="opaque" />
<param name="bgcolor" value="#ffffff" /> <embed type="application/x-shockwave-flash" width="950" height="360" src="../media/flash_final.swf" pluginspage="http://www.macromedia.com/go/getflashplayer" name=" Web" bgcolor="#ffffff" quality="high"></embed>
</object>
<!--[if !IE]>-->                               
<object id="flash" style="width: 950px; height: 350px; z-index: 0;" width="950" height="360" name="Web" data="media/flash_final.swf" type="application/x-shockwave-flash" wmode="transparent">
<param name="movie" value="media/flash_final.swf" />
<param name="quality" value="high" />
<param name="bgcolor" value="#FFFFFF" />
<param name="WMODE" value="transparent" />
<param name="allowScriptAccess" value="always" /> <!--<![endif]--> <!--[if !IE]>-->
</object>
<!--<![endif]--></p>
<p> </p>

Upvotes: 0

Views: 5412

Answers (1)

shanethehat
shanethehat

Reputation: 15570

I think you are wanting to center you flash horizontally, which is best done with automatic margins:

#flash {
   margin: 30px auto 20px auto; /* top right bottom left */
   width: 960px;
   height: 331px;
   z-index: 0;
}

As noted in the comments, you should really apply these rules to a parent layout element like a div rather than on the flash object itself.

Upvotes: 1

Related Questions