View Full Version : I'm new to HTML & CSS, How do i center a .swf movie on a webpage with a black backgro

Mar 4th, 2008, 09:29 PM
Whats the code, CSS & HTML, to center a .swf movie for a splash screen, onto a webpage, i'd like to background to be black as i've created a short intro movie which is mainly black, so it will look better ... i've hunted the web for the code to do this, and even tried youtube tutorials, but none of them show me how to center the movie, the size of the movie is 640px by 480px

any help much appreciated thx!

Mar 4th, 2008, 09:55 PM
I used to do it by putting it in a single-cell table and centering the table.

I know code that works, but I don't know if you would use it to style the object tag or put it inside a <div> tag and style that.

The code is:

style="margin:0 auto;"

One way to do it could be:

<div id="centerMovie" style="background-color:#000000;padding:30px;margin:0 auto;">
<object....(.swf location and attributes)..... />

If the background of your page is black, then you can leave out the padding.