Support Forums

Full Version: Align Embedded object (.swf) to center?
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
I've been throwing together a website to put on the back of my school project site in order to load a proxy and a few games for us to play with at school.

So far, here is my progress:
http://eshlads.cwahi.net/Photos/unicorn.php

My question is, how the hell do I align that game in the centre? I've tried all the different alignments dreamweaver shows up, and some of my own made up ones, haha.

This is the code I am currently using to "align" the object:
PHP Code:
<object width="653" height="490" align="middle">
  <
embed src="Unicorn.swf" align="middle"></embed>
</
object

Used:

PHP Code:
<center><object width="653" height="490" align="middle">
  <
embed src="Unicorn.swf" align="middle"></embed>
</
object></center

And it worked fine.
Is your link still active? Can't seem to open the page.

What I maybe do suggest is to put your <object></object> in a container div and align that center using margin: 0 auto; you have to give it a fixed width though.

Since I can't access your link Sad I can't test before giving you the advise, but please do try that and let me know if it works.
Code:
<object width="100" height="100" align="center">
<embed src="somefilename.swf" width="100" height="100" align="center">
</embed>
</object>

That should work.
Just wrap the object in a div.



PHP Code:
<div align="center">

</
div
ok thanks its usefull
Put it in a div as Charlie says Smile