Hi,

I'm trying to replicate this seemingly simple CSS for IE:

#mainwrap, #header {
        width: 58.5em;
        max-width: 97%;
}

This makes a layout that expands with the font size but not beyond the window. 
There's a full page example here:
http://alastairc.ac/code/blogged_examples/layout_test_em_max-width.html

But, I'm having a problem with the IE expression, the nearest I can get is:
#mainwrap, #header {
width:expression(document.body.clientWidth < 
((parseInt(document.body.currentStyle.fontSize)) * 0.73 * 12.84)? "97%" : 
"58.5em");}

Translated as: If window width less than 58.5em then width=97%, otherwise 
width=58.5em.

The problem seems to be that changing the font size doesn't change the result 
of this: document.body.currentStyle.fontSize

The visual result is that the expression only works at 58.5em of the default 
size, not higher or lower. The width will go to 100%, but only at 750px or 
below (58.5 ems at my default size).

You can test the reported font size by pasting into the address bar: 
javascript:alert(parseInt(document.body.currentStyle.fontSize));

The two examples I could find which do work, do not set any font size:
http://www.svendtofte.com/code/max_width_in_ie/
http://www.fu2k.org/alex/css/frames/ems

Is this possible in IE 5-6, or am I heading down a dead end? And if there are 
any good references for IE expressions, that would be nice :)

Tia,

-Alastair

(PS, please CC me if you reply, I'm on digest.)
______________________________________________________________________
css-discuss [EMAIL PROTECTED]
http://www.css-discuss.org/mailman/listinfo/css-d
IE7b2 testing hub -- http://css-discuss.incutio.com/?page=IE7
List wiki/FAQ -- http://css-discuss.incutio.com/
Supported by evolt.org -- http://www.evolt.org/help_support_evolt/

Reply via email to