polenz
07-30-2008, 10:20 PM
Hello, I was wondering how I can change the width of the body using and expression in CSS. The application I'm working on will only run in ie6 so I don't have to worry about other browsers. With IE6 I can't use min-width or max-width which would have been nice. What I'm trying to do is change the width to 1258px if the width is less than 1258 and set it to 100% if the width is over 1258. So if the screen resolution is 1400 wide then body width will be 100%. Width will always be a minimum of 1258px.
In the css I have the following:
body
{
width:expression(document.body.clientWidth < 1258? "1258px": "100%" );
}
In the bottom of my default.aspx page underneath the body tag I have this:
<script type="text/javascript">
{
alert("Width: " + document.body.clientWidth);
}
</script>
But Width never changes to equal what I have in the expression when I run the javascript. How do I get the expression to un in the CSS file? Is the expression incorrect?
Thanks
In the css I have the following:
body
{
width:expression(document.body.clientWidth < 1258? "1258px": "100%" );
}
In the bottom of my default.aspx page underneath the body tag I have this:
<script type="text/javascript">
{
alert("Width: " + document.body.clientWidth);
}
</script>
But Width never changes to equal what I have in the expression when I run the javascript. How do I get the expression to un in the CSS file? Is the expression incorrect?
Thanks