PDA

View Full Version : CSS positioning help needed.


MjC
05-19-2006, 03:56 AM
What would be the best way to make an object such as a flash movie always be centered in the screen? Vertically and hoizontally =) Help would be appreciated.

Kravvitz
05-19-2006, 04:09 AM
Here are two methods that don't require you to know the dimensions of the object.
Center Page Content Horizontally and Vertically (without <table>s) (http://www.dynamicsitesolutions.com/css/center_page_content_horizontally_and_vertically/)
Center Page Content Horizontally and Vertically (with a <table>) (http://www.dynamicsitesolutions.com/html/center_page_content_horizontally_and_vertically/)

If you do know the dimensions, then you can use the absolute position and negative margin method.
http://www.student.oulu.fi/~laurirai/www/css/middle/#absolute2
http://www.dynamicsitesolutions.com/css/center_element/

MjC
05-19-2006, 09:42 AM
Here is my code... I need the object centered horizontally and vertically. The object is 800x600. Here is the code:

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
<title>Morgan James Chadwick - Personal Portfolio</title>

</head>
<body background="../000splash/dotted.gif" leftmargin="0" topmargin="0" rightmargin="0" bottommargin="0" marginwidth="0" marginheight="0">
<!--url's used in the movie-->
<!--text used in the movie-->
<object type="application/x-shockwave-flash" data="MJC800x600WEB.swf" width="800" height="600">
<param name="allowScriptAccess" value="sameDomain" />
<param name="movie" value="MJC800x600WEB.swf" />
<param name="quality" value="high" />
<param name="scale" value="noscale" />
<param name="bgcolor" value="#d7deed" />
</object>
</body>
</html>