Monday, April 25, 2005

Fixed or fluid width? Elastic! | 456 Berea Street

A clear and concise tutorial on how to create a compromise between fixed and fluid layout. He calls it Elastic, but I think this takes it further than that. It's more of an Elastic/Fluid hybrid, taking the best from all worlds. It uses max-width for modern browsers and an expression within a conditional comment to simulate the same in IE.

Done this way a site remains flexible in width when the browser is smaller, up until you enlarge it so that the line length is optimal. At that point it stops getting wider. The only drawback is that in IE the simulated max-width is in pixels, so the line length doesn't scale with the font size. But since most sites won't even let you resize your text if you're using IE it's not that bad. If you're using IE sub-optimal line length is the least of your worries.

No comments: