Click to See Complete Forum and Search --> : Auto-expanding divs


onisemus
07-06-2004, 02:28 PM
Hi - quick question to the gurus out there that have the knowledge that I am seeking. =). Here's my problem:

Say I have 2 divs - both are of fixed width. One floats to the left, one float to the right. In between the two is another div, a middle one. I would like to have so, when a user resizes the window, the left and right divs float in their correct positions and stay at their fixed width and the middle div expands to fill in the space.

In IE setting the middle div to 100% width merely make the div 100% of the entire window, royally destroying the layout. I ask, is there a better way????

Vladdy
07-06-2004, 03:16 PM
If you use floats, that means you want them stack up when the window is getting too narrow to accomodate all three?

onisemus
07-06-2004, 03:28 PM
Hmm - now that I think about it, that would happen wouldn't it? The behavior I would want would be for the middle div to go to a minimum width if the windows shrunk beyond a certain point; so that the width of the left and right div would remain fixed, and the user would have to scroll across the page. Does that make sense? Would it be better to use tables in this instance?

Vladdy
07-06-2004, 04:49 PM
Tables are for tabular data.
If you want to have minimum width for the center blocks and always have the side blocks on the side - use margins on the center block and absolute positioning on the side ones.
See my site for such arrangement or this sample page: www.vladdy.net/Demos/ElementSizing.html