Forum Moderators: not2easy
I have tried this layout a number of ways: just a left and right collumn that are floated, but I don't know how to relate the 2. I have put the left column inside the right column and viceversa. Basically that is kind of what I have now. 1 middle wrapper div with the background that I want for the left column. Then I have the left column content floated withe the right column content positioned on top of the middle wrapper. This just doesn't automatically fill to the bottom of each other though unless I have the middle wrapper set to an exact number of pixels. I don't want to set an exact number of pixels as this content will change on every page.
Please help. I will explain more if this doesn't make sense. Thanks in advance.
HTML :
----------------------------------
<body>
<!-- Begin Wrapper -->
<div id="wrapper">
<!-- Begin Header -->
<div id="header">
</div>
<!-- End Header -->
<div class="middlewrapper">
<b class="b1"></b><b class="b2"></b><b class="b3"></b><b class="b4"></b>
<div class="boxcontent">
<div class="leftcolumn"><div id="leftpic"></div><p>content</p></div>
<div class="rightcolumn">
<b class="b1"></b><b class="b2"></b><b class="b3"></b><b class="b4"></b>
<div class="boxcontent">
<p>content</p>
</div>
<b class="b4"></b><b class="b3"></b><b class="b2"></b><b class="b1"></b>
</div>
</div>
<b class="b4"></b><b class="b3"></b><b class="b2"></b><b class="b1"></b>
</div>
<!-- Begin Footer -->
<div id="footer">
Footer
</div>
<!-- End Footer -->
</div>
<!-- End Wrapper -->
</body>
Relevant CSS:
----------------------------------
* { padding: 0; margin: 0; }
body {
font-family: Arial, Helvetica, sans-serif;
font-size: 13px;
background: #EBFFE8;
}
#wrapper {
margin: 0 auto;
width: 953px;
}
#header {
color: #333;
width: 953px;
float: left;
padding: 0;
height: 194px;
margin: 5px 0px 5px 0px;
filter:progid:DXImageTransform.Microsoft.AlphaImageLoader(enabled=true, src='images/NJT_headerback.png');
}
#footer {
width: 953px;
clear: both;
color: #000000;
margin: 5px 0px 5px 0px;
font-size:.7em;
text-align:right;
}
.middlewrapper {
background: transparent;
width:953px;
height:auto;
}
.middlewrapper .b1 {
display:block;
overflow:hidden;
height:1px;
margin:0 5px;
background:#666;
font-size:1px;
}
.middlewrapper .b2 {
display:block;
overflow:hidden;
height:1px;
margin:0 3px;
background:#C5F5FE;
border-left:2px solid #666;
border-right:2px solid #666;
font-size:1px;
}
.middlewrapper .b3 {
display:block;
overflow:hidden;
height:1px;
margin:0 2px;
background:#C5F5FE;
border-left:1px solid #666;
border-right:1px solid #666;
font-size:1px;
}
.middlewrapper .b4 {
display:block;
overflow:hidden;
height:2px;
margin:0 1px;
background:#C5F5FE;
border-left:1px solid #666;
border-right:1px solid #666;
font-size:1px;
}
.middlewrapper .boxcontent {
display:block;
background:#C5F5FE;
border:0 solid #666;
border-width:0 1px;
height:100%;
}
.leftcolumn {
float:left;
}
.rightcolumn {
background: transparent;
width:697px;
float:right;
height:100%;
position:relative;
margin-top:-5px;
margin-bottom:-5px;
}
.rightcolumn .b1 {
display:block;
overflow:hidden;
height:1px;
margin:0 5px 0 0;
background:#666;
font-size:1px;
}
.rightcolumn .b2 {
display:block;
overflow:hidden;
height:1px;
margin:0 3px 0 0;
background:#fff;
border-left:1px solid #666;
border-right:2px solid #666;
font-size:1px;
}
.rightcolumn .b3 {
display:block;
overflow:hidden;
height:1px;
margin:0 2px 0 0;
background:#fff;
border-left:1px solid #666;
border-right:1px solid #666;
font-size:1px;
}
.rightcolumn .b4 {
display:block;
overflow:hidden;
height:2px;
margin:0 1px 0 0;
background:#fff;
border-left:1px solid #666;
border-right:1px solid #666;
font-size:1px;
}
.rightcolumn .boxcontent {
display:block;
background:#fff;
border:0 solid #666;
border-width:0 1px;
height:100%;
padding-left:10px;
}
As far as I know, it's not easy, or even not possible to do it for fluid width cross browser with only CSS. The non-CSS way which will work would be to use a table. The CSS way which is easy but not cross-browser compatible (but it can be compatible with javascript) would be to use the display:table series of CSS display properties, and then correct it with javascript for those which don't support it correctly.
If you look at the code in IE, you will kind of see what I am looking for, but I want the right column to extend all the way to the bottom of the left column.
Basically the header and the main body columns have rounded corners, so not sure how I would accomplish this with a faux column.
Thanks again for any help.
Oh and lastly... I decided to view your posted code...
It only renders in IE. The whole page explodes horribly if I run it in Firefox, which is really bad, that means you're doing many quirky and/or incorrect coding practices (It probably has to do with the weird method of doing your rounded corners, which I find interesting nonetheless). You could maybe catch some of them with the W3C Validators:
[jigsaw.w3.org...]
[validator.w3.org...]