strivejason
Programmer
Hi there. I'm trying to get my DIV layout to let me centre 3 fixed-width DIVs in three full-screen-width DIVs: a header, a content section, and a footer which is pushed to the bottom of the content. So far, I've been unable to get the bottom DIVs to stretch across the screen without messing up the centred DIVs.
Here's what I'm working with:
Suggestions/comments/threats against my life?
I'd appreciate any input.
Thanks,
Jason
Here's what I'm working with:
Code:
<head>
<title>Title</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
<style type="text/css">
body {
margin-top: 0;
margin-left: 0;
background-image: url(/images/indx_body_bg.gif);
background-repeat: repeat-x;
}
/*I cheated; I want the header to have a background, so I put it in the body.*/
#content {
margin-left: 0px;
margin-right: 0px;
position: relative;
background-image: url(/images/Tile_cloudsfade.jpg);
background-repeat: repeat-x;
background-color: #B1CDF3;
}
#wrapper {
width: 780px;
margin-left: 0px;
position: relative;
}
#sample {
width: 388px;
position: absolute;
top: 0px;
left: 0px;
background-color: lightgreen;
}
/* -------------------------------
TOP/BOTTOM DIVS
--------------------------------*/
#header {
width: 780px;
height: 51px;
margin-left: 0px;
position: relative;
}
#bottom {
position: relative;
background-image: url(/images/indx_subnav_bg.jpg);
background-repeat: repeat-x;
}
/*Just a solid-color, beveled bar across the screen*/
#subnav {
width: 780px;
height: 40px;
margin-left: 0px;
position: relative;
}
#footer {
width: 780px;
margin-left: 0px;
position: relative;
}
/* -------------------------------
GENERAL
--------------------------------*/
h1 {
font-family: Verdana, Arial, Helvetica, sans-serif;
font-size: 18px;
font-weight: bold;
margin-left: 0px;
margin-bottom: 10px;
color: #000000;
}
p, li, td {
font-family: Verdana, Arial, Helvetica, sans-serif;
font-size: 12px;
color: #000000;
line-height: 1.2;
}
a {
color: #00304B;
text-decoration: none;
font-size: 12px;
}
a:hover {
color: #7DA42E;
text-decoration: none;
}
</style>
</head>
<body>
<div id="header">
<div style="position: absolute; right: 10px; top: 15px"><p><a href="#">link 1</a> |
<a href="#">link 2</a> |
<a href="#">link 3</a> |
<a href="#">link 4</a></p>
</div>
</div>
<div id="content">
<div id="wrapper">
<div id="sample">
<p>Lorem ipsum dolor sit amet,
consectetuer adipiscing elit. Sed augue
lectus, nonummy sit amet, elementum sed,
mollis eget, leo. Curabitur elementum erat
quis quam. Pellentesque sollicitudin tortor
a neque. Suspendisse facilisis facilisis
tortor. Nam sem elit, molestie et, mattis
id, porttitor eget, velit. Class aptent
taciti sociosqu ad litora torquent per
conubia nostra, per inceptos hymenaeos.
Maecenas diam sem, ultrices vitae, laoreet
eget, blandit ut, nulla. Praesent pede
justo, sollicitudin ut, suscipit vel,
pellentesque et, elit. Aliquam id wisi
ullamcorper nisl rutrum consectetuer. Cras
mi libero, tempus in, commodo dictum,
auctor at, eros. Ut sed augue. Nulla
tincidunt. In eu odio. Nunc ultricies justo
at eros. Nullam quis sapien nonummy enim
feugiat fringilla. Curabitur mi.
</p>
</div>
</div>
</div>
<div id="bottom">
<div id="subnav">
<p><a href="#">link 1</a> |
<a href="#">link 2</a> |
<a href="#">link 3</a> |
<a href="#">link 4</a></p>
</div>
<div id="footer">
<p>Footer information here. Footer information here. Footer information here.</p>
</div>
</div>
</body>
Suggestions/comments/threats against my life?
I'd appreciate any input.
Thanks,
Jason