Brywright
04-07-2005, 06:07 AM
Hi im having problems creating my first 2 column pure css layout (no tables) and was wondering if someone could give me some help.
As the screenshot shows its looking abit weird in internet explorer and need some help.
The first problem si with the ehader. The header background is set to blue and is 800px wide and 95px in height. I made a plain red header image and linked this into the header as shown in index.php. Yet although its the same size as the header area there is still a bit of blue background showin.
Why is this? and how can i make it so this small blue background dissappears?
My Other problem is with the main content (the purple css box which says slogan here). It wont line up fully with the menu on the left. Instead as you can see there is a small orange gap on the left (part of the background)
Would someone mind helping a first time css coder into removing these 2 bits of backgrounds and getting everything line up correctly?
All my code is shown below
index.php
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html>
<head>
<title>Test</title>
<LINK rel="stylesheet" type="text/css" href="style.css">
</head>
<body>
<div id="outer">
<div id="header">
<img src=/design/header.jpg>
</div>
<div id="nav">
menu here
</div>
<div id="main">
<h3>Slogan here</h3>
</div>
<div id="footer">
</div>
</div>
</body>
</html>
style.css
body {
background-color: #999999;
height:80%;
font-size:12px;
font-family:Verdana, Arial, Helvetica, sans-serif;
}
div#outer {
width: 800px;
height: 100%;
background-color:#FFFFFF;
margin-top: 50px;
margin-bottom: 50px;
margin-left: auto;
margin-right: auto;
padding: 0px;
border: 0px;
background-color: orange;
}
div#header {
padding: 0px;
width:800px;
height:95px;
margin: 0px;
background-color: blue;
}
div#nav {
width: 140px;
padding: 0px;
margin: 0px;
float: left;
height: 100%;
background-color: green ;
line-height: 1.4em; /*The line-height property sets the distance between lines. */
}
div#main {
width: 650px;
margin-left: 140px; /*sets starting left*/
background-color: purple ;
padding:3px;
}
div#submain {
width: 650px;
margin-left: 1410px; /*sets starting left*/
background-color: purple;
padding: 3px;
}
div#footer {
padding: 0px;
width:800px;
margin: 0px;
text-align: center;
background-color: yellow;
border-top: thin solid #000000;
}
As the screenshot shows its looking abit weird in internet explorer and need some help.
The first problem si with the ehader. The header background is set to blue and is 800px wide and 95px in height. I made a plain red header image and linked this into the header as shown in index.php. Yet although its the same size as the header area there is still a bit of blue background showin.
Why is this? and how can i make it so this small blue background dissappears?
My Other problem is with the main content (the purple css box which says slogan here). It wont line up fully with the menu on the left. Instead as you can see there is a small orange gap on the left (part of the background)
Would someone mind helping a first time css coder into removing these 2 bits of backgrounds and getting everything line up correctly?
All my code is shown below
index.php
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html>
<head>
<title>Test</title>
<LINK rel="stylesheet" type="text/css" href="style.css">
</head>
<body>
<div id="outer">
<div id="header">
<img src=/design/header.jpg>
</div>
<div id="nav">
menu here
</div>
<div id="main">
<h3>Slogan here</h3>
</div>
<div id="footer">
</div>
</div>
</body>
</html>
style.css
body {
background-color: #999999;
height:80%;
font-size:12px;
font-family:Verdana, Arial, Helvetica, sans-serif;
}
div#outer {
width: 800px;
height: 100%;
background-color:#FFFFFF;
margin-top: 50px;
margin-bottom: 50px;
margin-left: auto;
margin-right: auto;
padding: 0px;
border: 0px;
background-color: orange;
}
div#header {
padding: 0px;
width:800px;
height:95px;
margin: 0px;
background-color: blue;
}
div#nav {
width: 140px;
padding: 0px;
margin: 0px;
float: left;
height: 100%;
background-color: green ;
line-height: 1.4em; /*The line-height property sets the distance between lines. */
}
div#main {
width: 650px;
margin-left: 140px; /*sets starting left*/
background-color: purple ;
padding:3px;
}
div#submain {
width: 650px;
margin-left: 1410px; /*sets starting left*/
background-color: purple;
padding: 3px;
}
div#footer {
padding: 0px;
width:800px;
margin: 0px;
text-align: center;
background-color: yellow;
border-top: thin solid #000000;
}
