essdeeay
03-06-2007, 01:57 AM
What I'm basically trying to do here is a simple DIV layout, but all within a wrapper so the whole thing centers itself vertically in the browser.
If you look at the following code in IE, the DIVs are in the right place, but it doesn't center. If you look at it in Firefox, it centers ok, but the blue DIV drops out of the wrapper.
Is there a way I can fix this, and be cross-browser compliant at the same time?
Many thanks,
Steve
<html>
<head>
<title>Test page</title>
<style type="text/css" media="screen">
<!--
#wrapper { border: 1px red solid; width: 740px; margin: 0px auto; }
#title { border: 1px purple dotted; width 740px; margin: 0px auto; }
#navigation { border: 1px blue dotted; width: 125px; margin: 0px 0px 125px 0px; float: left; }
#content { border: 1px green dotted; position: relative; }
-->
</style>
</head>
<body>
<div id="wrapper">
<font color="red">This is the page wrapper, which should enclose all content</font>
<div id="title">
<font color="purple">This is where the title will go</font>
</div>
<div id="navigation">
<font color="blue">This is the navigation pane</font>
</div>
<div id="content">
<font color="green">This is the content pane</font>
</div>
</div>
</body>
</html>
If you look at the following code in IE, the DIVs are in the right place, but it doesn't center. If you look at it in Firefox, it centers ok, but the blue DIV drops out of the wrapper.
Is there a way I can fix this, and be cross-browser compliant at the same time?
Many thanks,
Steve
<html>
<head>
<title>Test page</title>
<style type="text/css" media="screen">
<!--
#wrapper { border: 1px red solid; width: 740px; margin: 0px auto; }
#title { border: 1px purple dotted; width 740px; margin: 0px auto; }
#navigation { border: 1px blue dotted; width: 125px; margin: 0px 0px 125px 0px; float: left; }
#content { border: 1px green dotted; position: relative; }
-->
</style>
</head>
<body>
<div id="wrapper">
<font color="red">This is the page wrapper, which should enclose all content</font>
<div id="title">
<font color="purple">This is where the title will go</font>
</div>
<div id="navigation">
<font color="blue">This is the navigation pane</font>
</div>
<div id="content">
<font color="green">This is the content pane</font>
</div>
</div>
</body>
</html>