Help - Search - Members - Calendar
Full Version: be center on browser
HTMLHelp Forums > Web Authoring > Markup (HTML, XHTML, XML)
mary_d
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
mary_d
like this:
http://d-graff.de/fricca/center.html
mary_d
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>
Darin McGrew
Your doctype declaration puts browsers in quirks mode. See Activating Browser Modes with Doctype.

MSIE does not support CSS-based centering in quirks mode.
This is a "lo-fi" version of our main content. To view the full version with more information, formatting and images, please click here.
Invision Power Board © 2001-2014 Invision Power Services, Inc.