I know this is possible; I've seen a few examples of it. In fact, www.csszengarden.com is a great example. When you go to the site, the content fits your browser window. When you resize or maximize the window, the content resizes to fit.
This is the main reason I've been using tables - they're "springy." But I've been taking the advice I read here seriously, and removed the table that handles my basic layout, replaced it with four divs. Unfortunately, I can't figure out how to make the main one change size with the browser window. When I click maximize, my site takes up about half the screen, and the rest is empty.
Here's a test page - the only one I've uploaded since getting rid of the tables: http://forrestcroce.com/Software/WebMaestro.html
The first div is the page header - works great. The next is the nav bar at left, with a fixed width of 150 px, followed by a 15 px div that has a button to hide or show the navbar. Finally, the last div holds the content. Its width should be the client area - 165 px, but you can't set formulas like that for width. I've tried not setting any width, and instead using min/max -width, but this puts the main div at the bottom of the rest of them.
I've looked at Zen Garden's code, and they're not using javascript to do this. ( Big relief! ) But ... I just don't understand well enough to figure out from their example how to do this on my own site.
So can I talk one of the no-tables gurus into sharing the secret?
|