PDA

View Full Version : Posting Flash banners on webpages


redsox9
08-23-2006, 03:09 PM
Hi, everyone:

I have an advertiser that gave me a Flash banner with the swf extension. I used a similar code to this to post it on my site:

<p class="centered_text"><embed src="file.swf" width="468" height="60" play="true" loop="true" quality="best" pluginspage="http://www.macromedia.com/shockwave/download/index.cgi?P1_Prod_Version=ShockwaveFlash"></p>

Obviously, my intent is to center the banner, but it just stays to the left. Do I need to create a class for the embedded object and, if so, would someone post an example? Of course, if I have the code incorrect, I'd like to know what I did wrong, too!

Much appreciated! :)

page1ink.
08-23-2006, 03:33 PM
A List Apart has a great article about using Flash and complying with a Strict XHTML Doctype (http://www.alistapart.com/articles/flashsatay).

As far as centering it, have you tried adjusting the margins?

embed {
position: absolute;
left: 50%;
margin-left: -100; /*assuming your object is 200px long*/
}

or you can adjust the padding-left to X if the width of the page is static.

redsox9
08-23-2006, 07:42 PM
Hi, page1ink.:

That reference link showed me EXACTLY what I was looking to do and it was as simple as 1-2-3. Thanks! :)

Basil
08-26-2006, 11:37 PM
Assuming you're using the strict doctype (for explorer) all you would have to do to center something is set the margins to auto..

<embed style="margin: 0 auto" />