Forum Moderators: not2easy
--------------------------------------
¦************************************¦
¦************Advertisement***********¦
--------------------------------------
¦************************************¦
¦**************Logo******************¦
--------------------------------------
¦**************¦************¦********¦
¦**************¦************¦********¦
¦**************¦************¦********¦
¦****Main******¦**Content2**¦Content3¦
¦**************¦************¦********¦
¦**************¦************¦********¦
¦**************¦************¦********¦
¦**************¦************¦********¦
¦**************¦************¦********¦
--------------------------------------
This seems to be pretty simple and common layout. Here is my code:
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<title>Untitled Document</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<style type="text/css">
#canvas
{
background: #FF0000;
width: 1024px;
}
#TopAdvBanner
{
background: #9c3;
}
#LogoBanner
{
background: #cc9;
}
#content
{
background: #361;
}
#MainContent
{
background: #999;
width: 410px;
float: left;
margin: 0px;
padding: 0px;
}
#Content2
{
background: #234;
width: 350px;
float: right;
}
#Content3
{
background: #123;
width: 264px;
float: right;
}
</style>
</head>
<body>
<div id="canvas">
Canvas
<div id="TopAdvBanner">
<h1>Top Banner</h1>
</div>
<div id="LogoBanner">
Logo Banner
</div>
<div id="content">
Content
<div id="MainContent">
Main Content
</div>
<div id="Content2">
Content 2
</div>
<div id="Content3">
Content 3
</div>
</div>
</div>
</body>
</html>
Please help!
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<title>Untitled Document</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<style type="text/css">
#canvas
{
background: #FF0000;
width: 1024px;
}
#TopAdvBanner
{
background: #9c3;
}
#LogoBanner
{
background: #cc9;
}
#content
{
background: #361;
}
#MainContent
{
background: #999;
width: 410px;
float: left;
margin: 0px;
padding: 0px;
}
#Content2
{
background: #89a;
width: 350px;
float: left;
}
#Content3
{
background: #567;
width: 264px;
float: left;
}
</style>
</head>
<body>
<div id="canvas">
Canvas
<div id="TopAdvBanner">
<h1>Top Banner</h1>
</div>
<div id="LogoBanner">
Logo Banner
</div>
<div id="content">
Content
<div id="MainContent">
Main Content
</div>
<div id="Content2">
Content 2
</div>
<div id="Content3">
Content 3
</div>
</div>
</div>
</body>
</html>
However, the following code does not work in IE6 (but does in Opera):
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN">
<HTML>
<HEAD>
<TITLE>A frame document with CSS 2.1</TITLE>
<STYLE type="text/css" media="screen">
BODY { height: 8.5in } /* Required for percentage heights below */
#header {
position: fixed;
width: 100%;
height: 15%;
top: 0;
right: 0;
bottom: auto;
left: 0;
}
#sidebar {
position: fixed;
width: 10em;
height: auto;
top: 15%;
right: auto;
bottom: 100px;
left: 0;
}
#main {
position: fixed;
width: auto;
height: auto;
top: 15%;
right: 0;
bottom: 100px;
left: 10em;
}
#footer {
position: fixed;
width: 100%;
height: 100px;
top: auto;
right: 0;
bottom: 0;
left: 0;
}
</STYLE>
</HEAD>
<BODY>
<DIV id="header"> ... </DIV>
<DIV id="sidebar"> ... </DIV>
<DIV id="main"> ... </DIV>
<DIV id="footer"> ... </DIV>
</BODY>
</HTML>
This code was the example from the web I spoke of. It's using fixed positioning.
Would you recommend another method for for my layout? I was looking to use floats but I am open to other methods if they are better.
Thanks!
I assumed you wanted no-scrolling and auto resizing from your original code since you where using height/width percentages. FF and Opera render borders funky.
<HTML>
<HEAD>
<TITLE>A frame document with CSS 2.1</TITLE>
<STYLE type="text/css" media="screen">
body{margin:0}
div{background-color:gray;}
#header, #footer{width:100%; height:10%; background-color:green}
#sidebar{width:10%; height:80%}
#main{width:90%; height:80%}
.line{float:left;}
</STYLE>
</HEAD>
<BODY>
<DIV id="header" class=line> header </DIV>
<DIV id="sidebar" class="line"> sidebar </DIV>
<DIV id="main" class="line"> main </DIV>
<DIV id="footer" class=line> foot </DIV>
</BODY>
</HTML>