Just when I think I have a complete handle on CSS, something comes along to pop that bubble of confidence! I'm working on a simple series of web pages that have:
- A header
- A left menu
- The main content directly to the right of the left menu
- A footer
So essentially a 2-column layout. I know the old trick of setting the background colour to be the same as either the left or right DIV (the left menu or main content in this case) but I like to have gradient backgrounds. Here's an example of the page I'm working on. Do you notice that there's a large white gap on the right and below the main content DIV but above the footer? I've been playing around with CSS for a couple of hours now and just can't seem to figure out how to make it work. I'm hoping that CSS guru might be able to help.
Here are the pertinent parts of the CSS file:
html, body
{
background-color:white;
margin:0;
border:none;
width:100%;
min-width:100%;
}
div.container
{
width:100%;
min-width:950px;
margin:auto;
}
div.leftMenu
{
float:left;
width:140px;
min-height:550px;
vertical-align:top;
margin:0;
padding:10px;
padding-top:130px;
border:none;
background:lightgreen url(/Images/Backgrounds/blueGreenGradient.jpg);
}
div.mainContent
{
float:left;
background:lightblue url(/Images/Backgrounds/lightBlueGradientTall.jpg);
height:100%;
width:80%;
margin:auto;
vertical-align:top;
}
I don't know if this will help, but in "div.mainContent" if I increase the width to 90% then this DIV is forced below the left panel. That's clearly not what I want. What I'd like is for the main content to occupy 100% of the width to the right of the left panel.
Any ideas?
Robert W.