Forum Moderators: open
You'd think this was all bog-standard stuff. Not so.
In practice, the look is being affected by scalability. For example, a display in line horizontal menu was cutting across a left hand column as it scaled. So the menu had to go right to the top of the page.
And max width scaling is possible in all browsers with valid CSS - except IE! It is possible to max-width limit IE - but only with a proprietary extension that fails w3c validation. Just for the moment, I have made the overall page wrapper 955px. But I need a long-term solution.
Given that achieving all the objectives is not possible, I will have to compromise. I would prefer not to use javascript. OTOH, using it would not fail w3c validation, whereas using the proprietary IE CSS will. I think the best compromise is to use javascript, and accept that for the small number of no-javascript users, the pages will look a little quirky on high resolution screens.
But I would be very interested to see our views on this.
I assume you're going to do this, but I'd also make sure the resize javascript is wrapped in a conditional comment so that other users don't have to download the script file.
<!--[if [b]lt IE 7[/b]]>
<script type="text/javascript" src="thejs.js"></script>
<![endif]--> However, it is easier to use the IE expression within CSS:
width:expression(document.body.clientWidth > 750? "750px": "auto" ); The expression is actually Javascript anyway. As you say, it will not pass validation, although it will not interfere with any other rules or break other browsers. Up to you whether you can live with that. If you can't, you can use the IE conditional comment in your document head to include just that rule rather than calling another file for just one rule:
<!--[if lt IE 7]>
<style type="text/css">
body {
width:expression(document.body.clientWidth > 750? "750px": "auto" );
}
</style>
<![endif]--> <added>Robin_reala beat me to it ;)</added>