Q: Centering flash on page

M

martin weinberger

Hi All,

I'm not that familiar with HTML coding yet. I have a flash image that I am
showing in an HTML page. The flash displays fine, but displays in the upper
righthand corner. What would I have to add to center the flash image in the
browser window? I've copied the source below.

<html>
<head>
<title>Macromedia Flash (SWF) Movie Created by Camtasia Studio</title>
</head>
<body bgcolor="#FFFFFF">
<object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000"
codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.ca
b#version=5,0,0,0" width="510" height="407" id="myMovieName">
<param name="movie"
value="Introduction_controller.swf?csConfigFile=Introduction_config.xml">
<param name="quality" value="high">
<param name="bgcolor" value="#FFFFFF">
<param name="FlashVars" value="csConfigFile=Introduction_config.xml">
<embed
src="Introduction_controller.swf?csConfigFile=Introduction_config.xml"
FlashVars="csConfigFile=Introduction_config.xml" quality=high
bgcolor=#FFFFFF width=510 height=407 type="application/x-shockwave-flash"
pluginspace="http://www.macromedia.com/go/getflashplayer">
</embed>
</object>
</body>
</html>

Thanks in advance.
 
T

Talc Ta Matt

Here's the Tables version of it below. It'll work fine. Does anyone know how to
reproduce the equivalent of HTML's valign=middle tag in CSS for a DIV?


<TABLE width=100% height=100%><TR><TD align=center>

WHATEVER GOES HERE

</TD></TR></TABLE>
 
T

Toby A Inkster

Talc said:
Does anyone know how to
reproduce the equivalent of HTML's valign=middle tag in CSS for a DIV?

div {
height: WHATEVER;
margin-top: auto;
margin-bottom: auto;
}

The div will expand vertically to fit whichever container it is in,
centring the content.

Probably doesn't work in IE5/Win or quirks mode of IE6/Win.
 
E

EightNineThree

Talc Ta Matt said:
Here's the Tables version of it below. It'll work fine. Does anyone know how to
reproduce the equivalent of HTML's valign=middle tag in CSS for a DIV?


<TABLE width=100% height=100%><TR><TD align=center>

WHATEVER GOES HERE

</TD></TR></TABLE>

Fitst "It'll work fine" is a lie.
"Height" is an invalid attribute of <table> and will NOT "work fine" in any
browser when a proper DTD is supplied.
 
T

Talc Ta Matt

Fitst "It'll work fine" is a lie.
"Height" is an invalid attribute of <table> and will NOT "work fine" in any
browser when a proper DTD is supplied.

Please give an example of when this doesn't work. I've yet to see it.
 
R

rf

Talc Ta Matt said:
Please give an example of when this doesn't work. I've yet to see it.

The following "works" with IE, Mozilla and Opera:

<html>
<head>
</head>
<body>
<table height="100%" bgcolor="#00ffff">
<tr>
<td>
text
</td>
</tr>
</table>
</body>
</html>

The following causes the height to be (correctly) ignored in IE5 and Mozilla

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN"
"http://www.w3.org/TR/html4/strict.dtd">
<html>
<head>
</head>
<body>
<table height="100%" bgcolor="#00ffff">
<tr>
<td>
text
</td>
</tr>
</table>
</body>
</html>

Note the qualification: "when a proper DTD is supplied".

Cheers
Richard.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,769
Messages
2,569,580
Members
45,054
Latest member
TrimKetoBoost

Latest Threads

Top