PDA

View Full Version : DIV - fit to available area


Ms.Longstocking
04-01-2008, 10:33 PM
Good day,
I am having some difficulty with fitting a div to the area available.
See attachment.

My page is 1000px in width.
The LeftMenu area will sometimes be rendered, and sometimes not.
I need for the content area to expand to fit the remaining space.
For instance, the LeftMenu area is 150px in width(static). The content area will either be 850px or 1000px.

I have tried putting the LeftMenu and Content Area in a wrapper div with no success. I'm obviously missing something.

Any ideas?

-MizPippz

jcdevelopment
04-01-2008, 10:57 PM
instead of statically putting the width, can you not do

width:100%; ?

not sure if you tried that!

Ms.Longstocking
04-01-2008, 11:47 PM
When I try that, the content area is given a width of 1000px and appears under the LeftMenu.

Ms.Longstocking
04-02-2008, 12:28 AM
The styles...

.LeftMenu
{
width:140px;
min-height:585px;
float:left;
}

.separator
{
width:984px;
height:20px;
float:left;
}

.header
{
width:984px;
height: 118px;
float:left;
}

.contentArea
{
min-height:585px;
background:white;
float:left;
width:100%;
}

zfred09
04-02-2008, 02:40 AM
Well my first question would be how does the left menu close? Is it with javascript/ajax etc. or does the page reload?

Ms.Longstocking
04-03-2008, 12:24 AM
I'm a bonehead. I'll just create a user control and include it (as a block element) as part of the content area when need-be.