In the following example, you can see that I have created a page which essentially has 4 differently coloured sections. I have managed to set the relevant page and div tag colors so that each background color seems to join it's adjoining columns.
However, if you swap the text in the "maincol" div with the text in the "leftcol", the maincol color no longer joins up with the footer div.
Does this make sense, and if so, what do people recommend in this situation (bearing in mind that the text from both "leftcol" and "maincol" would be dynamic so there would be situations where one column is longer than the other and vice-versa)?
____________________________________________________________
Need help finding an answer?
Try the Search Facility or read FAQ222-2244 on how to get better results.
Code:
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "[URL unfurl="true"]http://www.w3.org/TR/html4/strict.dtd">[/URL]
<html>
<head>
<title>Paye Layout Test</title>
<meta http-equiv="content-type" content="text/html;charset=utf-8" />
<style>
html, body{
margin:0;
padding:0;
text-align:center;
}
#pagewidth{
width:761px;
text-align:left;
margin-left:auto;
margin-right:auto;
background-color:#C0FFC0;
}
#header{
position:relative;
height:113px;
background-color:#FF0000;
width:100%;
}
#leftcol{
width:150px;
float:left;
position:relative;
background-color:#C0FFC0;
}
#maincol{background-color: #FFFFC0;
float: right;
display:inline;
position: relative;
width:611px;
}
#footer{
height:150px;
background-color:#0000FF;
clear:both;
}
</style>
</head>
<body>
<div id="pagewidth" >
<div id="header" > Head </div>
<div id="wrapper">
<div id="maincol" >
<p>
Lorem ipsum dolor sit amet, consectetuer adipiscing elit, sed diam nonummy nibh euismod tincidunt ut laoreet dolore magna aliquam erat volutpat. Ut wisi enim ad minim veniam, quis nostrud exerci tation ullamcorper suscipit lobortis nisl ut aliquip ex ea commodo consequat. Duis autem vel eum iriure dolor in hendrerit in vulputate velit esse molestie consequat, vel illum dolore eu feugiat nulla facilisis at vero eros et accumsan et iusto odio dignissim qui blandit praesent luptatum zzril delenit augue duis dolore te feugait nulla facilisi.
</p>
</div>
<div id="leftcol" >
<p>
Small Text
</p></div>
</div>
<div id="footer" > Footer
</div>
</div>
</body>
</html>
However, if you swap the text in the "maincol" div with the text in the "leftcol", the maincol color no longer joins up with the footer div.
Does this make sense, and if so, what do people recommend in this situation (bearing in mind that the text from both "leftcol" and "maincol" would be dynamic so there would be situations where one column is longer than the other and vice-versa)?
____________________________________________________________
Need help finding an answer?
Try the Search Facility or read FAQ222-2244 on how to get better results.