WebSardine
09-01-2006, 10:05 PM
New here...go easy.
I am trying to find a solution to a problem I often run into. I am trying to figure out how to set a background for a page and then place a centered column on the page that runs the full length of the page no matter how much content I have in the middle column. I seem to run into this problem a lot and always have to find a work around. I want to solve this issue once and for all. Can you help?
Here's is a conceptual example of it not working:
CSS file:
body {
margin:0;
padding:0;
background:#003399;
}
* {margin:0px; padding:0px;}
#content {
background:#FF0000;
width:800px;
margin:0 auto;
}
HTML code:
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//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" />
<link href="css_example.css" rel="stylesheet" type="text/css" />
<title>Untitled Document</title>
</head>
<body>
<div id="content">
<p>Here is a little content</p>
</div>
</body>
</html>
I have also hosted the example so it is easy for you to take a look at it.
http://www.soundparanoia.com/slop/css_example.html
In the example, I want the red to extend the length of the page no matter what the content is. I know the example is trivial, but I think it's probably the easiest one to use for exemplifying this issue.
Thanks for the help!
I am trying to find a solution to a problem I often run into. I am trying to figure out how to set a background for a page and then place a centered column on the page that runs the full length of the page no matter how much content I have in the middle column. I seem to run into this problem a lot and always have to find a work around. I want to solve this issue once and for all. Can you help?
Here's is a conceptual example of it not working:
CSS file:
body {
margin:0;
padding:0;
background:#003399;
}
* {margin:0px; padding:0px;}
#content {
background:#FF0000;
width:800px;
margin:0 auto;
}
HTML code:
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//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" />
<link href="css_example.css" rel="stylesheet" type="text/css" />
<title>Untitled Document</title>
</head>
<body>
<div id="content">
<p>Here is a little content</p>
</div>
</body>
</html>
I have also hosted the example so it is easy for you to take a look at it.
http://www.soundparanoia.com/slop/css_example.html
In the example, I want the red to extend the length of the page no matter what the content is. I know the example is trivial, but I think it's probably the easiest one to use for exemplifying this issue.
Thanks for the help!