
Originally Posted by
jscheuer1
Mike, are you listening?
Yes. There isn't really much to add.
HTML is inherently fluid; capable of adapting to viewport size automatically. If it doesn't, you've done something to stop it, such as using absolute widths in too many places. Clearly, there are places where specific widths are necessary, such as when working in concert with images, and navigation sidebars. However, the majority of your document should be capable of reflowing if necessary.
Although fluidity would mean your page could spread across the entire viewport, you can prevent this happening using the max-width CSS property.
Code:
body {
max-width: 40em;
}
Unfortunately, IE doesn't support this property, however you should be able to emulate it (but only in pixels):
Code:
body {
/* Explicitly specify the margin so we know
* what to subtract in the expression.
*/
margin: 10px;
padding: 0;
max-width: 40em;
}
* html body {
width: expression(Math.min(document.documentElement.clientWidth - 20, 600));
}
This will only work if the document is rendered in "Standards Mode". That is, you have a complete DOCTYPE specified for the document.
Mike
Bookmarks