Nedals
02-27-2003, 03:04 PM
I'm new to CSS layout. I've used tables in the past so any comments on this simplified code would be appreciated.
This faily simple CSS layout that works correctly in IE but falls apart in NS4xx. Is there a technique to keep the page ledgible in NS.
Currently the footer div moves to the right and overlaps the other divisions.
<html><head><title>CSS Layout</title>
<style type=text/css>
body { background:ffffff; margin:0px; }
#header { text-align:center; width:100%; border:black 1px solid; }
#leftdiv { float:left; width:200; height:300; border:black 1px solid; }
#container1 { float:left; width:auto; border:red 1px solid; }
#centerdiv { float:left; width:70%; height:200px; border:black 1px solid; }
#rightdiv { float:right; width:30%; height:200px; border:black 1px solid; }
#footer { float:left; width:100%; height:100px; border:black 1px solid; }
</style>
</head>
<body>
<div id="header"><h3>header</h3><h1>CSS LAYOUT</h1>The layout needs to work for window widths of 800px and up</div>
<div id="leftdiv"><h3>leftdiv</h3>FIXED width of 200px.</div>
<div id="container1">
<div id="centerdiv"><h3>centerdiv</h3></div>
<div id="rightdiv"><h3>rightdiv</h3></div>
<div id="footer"><h3>footer</h3></div>
</div>
</body></html>
This faily simple CSS layout that works correctly in IE but falls apart in NS4xx. Is there a technique to keep the page ledgible in NS.
Currently the footer div moves to the right and overlaps the other divisions.
<html><head><title>CSS Layout</title>
<style type=text/css>
body { background:ffffff; margin:0px; }
#header { text-align:center; width:100%; border:black 1px solid; }
#leftdiv { float:left; width:200; height:300; border:black 1px solid; }
#container1 { float:left; width:auto; border:red 1px solid; }
#centerdiv { float:left; width:70%; height:200px; border:black 1px solid; }
#rightdiv { float:right; width:30%; height:200px; border:black 1px solid; }
#footer { float:left; width:100%; height:100px; border:black 1px solid; }
</style>
</head>
<body>
<div id="header"><h3>header</h3><h1>CSS LAYOUT</h1>The layout needs to work for window widths of 800px and up</div>
<div id="leftdiv"><h3>leftdiv</h3>FIXED width of 200px.</div>
<div id="container1">
<div id="centerdiv"><h3>centerdiv</h3></div>
<div id="rightdiv"><h3>rightdiv</h3></div>
<div id="footer"><h3>footer</h3></div>
</div>
</body></html>