Printable Version of Topic

Click here to view this topic in its original format

HTMLHelp Forums _ Markup (HTML, XHTML, XML) _ be center on browser

Posted by: mary_d Mar 4 2009, 02:26 PM

hi!
please help me! i have a flash (swf) object 1080x560px, and i would like to put it on a html page.
BUT, i would like to be center on top, bottom, right, left on any browser....
please, anyone who knows???? thank you........... rolleyes.gif

Posted by: mary_d Mar 4 2009, 02:45 PM

like this:
http://d-graff.de/fricca/center.html

Posted by: mary_d Mar 4 2009, 03:33 PM

i find and i 've tried something. whats wrong now??

here is the code:


<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<title>CSS vertical center using float and clear</title>
<style type="text/css">

* {
margin:0;
padding:0;
}

html, body {
height:100%;
}

body {
background-color:#7F7F7F;
color:#FFFFFF;
font:100.01%/1.4 sans-serif;
text-align:center; /* horizontal centering for IE Win quirks */
}

#distance {
width:1px;
height:50%;
background-color:#fc6;
margin-bottom:-13.75em; /* half of container's height */
float:left;
}

#container {
margin:0 auto;
position:relative; /* puts container in front of distance */
text-align:left;
height:35em;
width:67.5em;
clear:left;
background-color:#7F7F7F;
border:1px solid #c50;
border-top-color:#fff;
border-left-color:#fff;
}

#container div {
font-size:80%;
float:right;
width:17em;
margin-left:2em;
}

#container div h2 {
font-size:120%;
font-weight:bold;
text-transform:uppercase;
margin:1em 0 0;
}

#container div h3 {
font-size:100%;
font-weight:bold;
margin:.5em 0 0 .75em;
}

#container ul {
margin-left:2em;
}

#container li span {
font-size:70%;
}


#container h1 {
font-size:120%;
padding-top:2.4em;
margin-left:2.4em;
}

#container p {
margin:1.5em 13.6em 1.5em 3em;
}

address {
font-weight:normal;
font-size:80%;
font-style:normal;
text-align:right;
margin:0 20em 0 3em;
}

body,td,th {
font-family: Verdana, Arial, Helvetica, sans-serif;
}
</style></head>
<body>

<div id="distance"></div>
<div id="container">
<h1> </h1>
</div>

</body>
</html>

Posted by: Darin McGrew Mar 4 2009, 04:53 PM

Your doctype declaration puts browsers in quirks mode. See http://hsivonen.iki.fi/doctype/.

MSIE does not support CSS-based centering in quirks mode.

Powered by Invision Power Board (http://www.invisionboard.com)
© Invision Power Services (http://www.invisionpower.com)