all groups > macromedia flash sitedesign > september 2007 >
You're in the

macromedia flash sitedesign

group:

absolute center SWF on HTML


Re: absolute center SWF on HTML Rob Dillon
9/14/2007 3:03:42 PM
macromedia flash sitedesign:
Use something like this:

#fullFloater {
position:absolute;
top:50%;
left:50%;
right:50%;
bottom:50%;
margin-top: -300;
margin-left: -450;
}

set the margin-top value to be half the height of your .swf and the
margin-left to be half the width of your .swf, each with a negative value.


--
Rob

___________
Rob Dillon
Adobe Community Expert
http://www.ddg-designs.com
absolute center SWF on HTML Rylz
9/14/2007 4:59:52 PM
I want to have my SWF be centered on the host HTML page both horizontally and
vertically. I've got it to center horizontal, but can't get it vertically.
Below is the tag I use in a CSS to try and center. It will center horizontal,
like I said, but that's it.


margin-left: auto;
width:800px;
height:400px;
margin-right:auto;
margin-top:auto;
margin-bottom:auto;
height:100%;
clear:left;
Re: absolute center SWF on HTML Rylz
9/14/2007 7:14:04 PM
That didn't work. It puts the SWF to the far bottom-right corner of the page
and I have to scroll to see it. I took your code exactly and changed the
margins appropriately. I have an 800w X 400h SWF, so I made margin-top "-200"
and margin-left "-400".
Re: absolute center SWF on HTML Rylz
9/14/2007 7:16:06 PM
AddThis Social Bookmark Button