PDA

View Full Version : Aligning a flash movie


thegreendove
06-13-2005, 05:58 PM
I want to align a flash movie (600x350) in the center (horizontally) and middle (vertically) of an HTML page dynamically so whatever the resolution is it just fits in the center and in the middle.
I tried the <div> tag:
<div align="center" valign="middle">My Flash Movie</div>
But it just aligns the flash movie horizontally and puts it in the top-center of the HTML page. How can I put it in the middle-center of an HTML page?
Is it possible doing so with javascript screen.width & screen.height methods and HTML <span> tag? Please help me out. Thanx.

Boskic.com
06-13-2005, 06:38 PM
Put content betweentable {
margin: 0px;
padding: 0px;
height: 100%;
width: 100%;
vertical-align: middle;
text-align: center;
}
or use
#somediv {
display: inline;
list-style: none;
position: absolute;
left: 50%;
top: 50%;
width: 760px;
height: 420px;
margin-left: -380px;
margin-top: -210px;
margin-right: 0;
margin-bottom: 0;
padding: 0;
}

LJK
06-27-2005, 06:09 AM
P.S. - Or set it using css styles:

.content embed, .content object{
margin:20% auto;}

would place it 20% from anything before and after it and center it hz.
[and within a div class="content" whose w and h are also set using %]

El