Help - Search - Members - Calendar
Full Version: What is wrong with my simple layout!?!?
HTMLHelp Forums > Web Authoring > Cascading Style Sheets
Mr Awesome!!
This is a very simple 'header-3column-footer' layout... but it just won't work! Maybe it's because it's 4:00am but I can't figure out the problem. I've searched and tried at least 20 different possible solutions - all to no avail! Right now, I don't feel all that awesome.... sad.gif

Here is CSS:
body {
padding: 0;
margin: 0;
text-align: center;
background-color: black;
}

/*Layout*/
#container {
width: 940px;
margin-top: 10px;
margin-right: auto;
margin-bottom: 10px;
margin-left: auto;
padding: 0;
text-align: left;
}
#banner {
margin: 0;
padding: 0;
height: 100px;
background-color: #ffffff;
}
#navbar {
margin: 0;
padding: 0;
width: 940px;
height: 25px;
padding: 0;
font-color: #ffffff;
background-color: red;
}
#sidebarL {
width: 180px;
float: left;
margin: 0;
padding: 0;
background-color: blue;
}
#main {
width: 580px;
margin: 0;
padding: 0;
background-color: #ffffff
}
#sidebarR {
width: 180px;
float: right;
margin: 0;
padding: 0;
background-color: blue;
}
#footer {
width: 940px;
height: 25px;
clear: both;
margin: 0;
padding: 0;
text-align: center;
background-color:red;
}

And XHTML:
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1" />
<title>Title</title>
<link rel="stylesheet" type="text/css" href="../test/test1.css" />
</head>

<body>
<div id="container">
<!--Banner-->
<div id="banner">
<h1>Banner</h1>
</div>

<!--Navigation Bar-->
<div id="navbar">
</div>

<!--Main Content-->
<div id="main">
<h2>Title</h2>
<p></p>
</div>

<!--Left Sidebar-->
<div id="sidebarL">
<p></p>
</div>

<!--Right Sidebar-->
<div id="sidebarR">
<p></p>
</div>

<!--Footer-->
<div id="footer">
</div>
</div>
</body>
</html>

Any help would be much appreciated!!! biggrin.gif biggrin.gif biggrin.gif I am no CSS master but, I thought I knew enough to do something as simple as a layout. With all the issues I've been having, and the problems I've seen, read about, and anticipate... I think I may just stick with tables. rolleyes.gif

Thanks again!
Mr. (not-so-much-at-the-moment) Awesome!! cool.gif
Frederiek
Set the div #main to float: left too and place its HTML between the HTML of sidebarL and sidebarR.
Mr Awesome!!
QUOTE(Frederiek @ Sep 10 2009, 05:14 AM) *

Set the div #main to float: left too and place its HTML between the HTML of sidebarL and sidebarR.


Arg-dag!! Grrr..... See, I did that in the CSS but forgot to go back and change the HTML!!! 4:00am is NOT the most productive time to work on things rolleyes.gif Thanks for pointing that out to me. biggrin.gif

Mr. (once-again) Awesome cool.gif
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-2009 Invision Power Services, Inc.