/* Left menu */
.leftMenu{
width: 200px;
border:2px solid green;
float:left;
background-color:#c0c0c0;
}
/* Main Content area */
.mainBox{
border:2px solid red;
background-color: #ffffff;
}
.mainWrapper{
border:2px solid white;
}
With
<div class="mainWrapper">
<div class="leftMenu">
left
</div>
<div class="mainBox">
main<br /><br /><br /><br /><br />
</div>
<div class="clear"></div>
</div>
How the blazes do I get the left menu to extend to the bottom?
Please note I've tried faux columns but they just don't work as the white main box just is at the front for some reason.
What about this?
http://jsfiddle.net/PH3t2/
I've added
postion:absolute
,top:0
andbottom:0
to your leftmenuI've given mainBox
padding-left: 205px
I've given mainWrapper
position:relative
Feel free to add content to mainBox to see that leftMenu grows as well.
To finish this off and make it work in IE6, add:
you need set a fixed height for the
.mainWrapper
for example100px
; and then you set the height of.leftMenu
to100%;
Edit: According your comment, I am not sure if it possible with pure css. If it's acceptable a javascript solution then you can use jquery and the following code:
Live example: http://jsbin.com/udowu4/2
When using faux columns, you need to set background image to .mainWrapper.
Set .mainBox background to transparent and make .mainWrapper background as 200px gray at left side and all other width to white.
CSS Faux columns is the best possible solution. The following solution might work but you could end up with other problems. Note: This works regardless of which column is taller.