Forum Moderators: not2easy

Message Too Old, No Replies

Divs not centering in firefox

Need help in keeping my web page centred in firefox

         

Matrix015

8:36 am on Jul 26, 2009 (gmt 0)

10+ Year Member



My web page centers just fine in ie but firefox aligns left. Please help!
I know it is alot of code, but I have been reading for hours about the problem and all the fixes that I see dont work......

<style type="text/css">
<!--
#TitleBox {
position: relative;
left:0px;
top:10px;
width:320px;
height:75px;
z-index:1;
}

#EnterBox {
position:relative;
left:0;
top:10px;
width:209px;
height:48px;
z-index:1;

}

#CopywrightBox {
position:relative;
left:0;
top:200px;
width:233px;
height:24px;
z-index:104;
color: #999;
}

body {
text-align: center;
margin: 0 auto;
padding: 0px;
}

#container {
text-align:center;
width:900px;
height:900px;
margin:0px auto 0px auto ;
}
-->
</style>
</head>

<body style="text-align:center">
<div id="container">

<div id="TitleBox">
<div align="center"><img src="blossoms.png" width="301" height="61" alt="#" /></div>
</div>

<div id="EnterBox">
<div align="center"><a href="#"><img src="enter.png" width="204" height="35" border="0" alt="Enter Site" /></a></div>
</div>

<div id="CopywrightBox">
<div align="center">&copy; 2009</div>
</div>

</div>
</body>
</html>

[edited by: SuzyUK at 10:44 am (utc) on July 26, 2009]
[edit reason] examplified & shortened code [/edit]

Matrix015

4:23 pm on Jul 26, 2009 (gmt 0)

10+ Year Member



Thanks in advance to all of those looking at this problem. I figured it out sometime during my dreams last night!
I needed to add the "margin 0px auto 0px auto;" to every div. Now it works like a charm with the exception of one flash item not ligning up correctly when going from IE to FF.
Thanks again!