vmhatup — 2010-06-07T19:00:46-04:00 — #1
I recently found a page that shows how to create a layout where the left and right column have with fixed width, and the middle column takes up the remaining space.
In my case, I'd like to have a fixed-width middle column, and that the left and right columns take up all remaining space equally between both columns. There can't be any overlapping between the middle column and the left/right columns.
Any help is appreciated.
rayzur — 2010-06-07T19:27:58-04:00 — #2
Hi vmhatup, Welcome to SitePoint!
Yes that can be done but it requires some trickery with floats and negative margins.
Here is a live example of the layout you have described.
Here is an exploded view of the general float structure.
With that last link I posted, drag your browser window back and forth and you will see the 50/50 floats (pink and palegreen) drop down as the widow is re-sized. It is those floats that get negative margins which allow the fixed width center column to stay in place.
The wrapper div is set in a %width so it will adjust to your viewport and let the sidebars extend so you can see what is going on. You can also view the page source for the css/html.
vmhatup — 2010-06-08T01:33:36-04:00 — #3
Thanks for your reply. I still need to insert the listview to see how it looks.