Log in

View Full Version : IE css expression , and valide W3C no solution ?



sfchun
06-17-2008, 08:02 AM
Hello,

I'm trying to get a valide CSS on my site, using : http://jigsaw.w3.org/css-validator/

but in my frameset i had to put the 'red' line in code bellow, to force IE having a good behaviour ; and of course it is not a valide CSS code...

i got this error :
Value Error : height Parse Error document.body.clientHeight - 255 + "px")

Any idea to solve this problem ??



#left-side-frame {
position: absolute;
top: 110px;
bottom: 20px;
left: 0px;
width: 20%;
height: (document.body.clientHeight - 255 + "px"); /* IE fix */
text-align: left;
}

rangana
06-17-2008, 08:18 AM
Have you tried to use conditional comments instead. Not really certain if it will validate as I haven't tried it (yet), but maybe worth a try:


<!--[if IE]>
#left-side-frame
{
height: (document.body.clientHeight - 255 + "px"); /* IE fix */
}
<![endif]-->

sfchun
06-17-2008, 08:33 AM
Nop , in fact my CSS is in an external file (don't know realy if this have an importence)...

Anyway if i add your lines, my errors are still here , and the added lines are rejected (see below) :
Parse Error IE]> #right-side-frame

Lexical error at line 71, column 3. Encountered: "[" (91), after : "<!" [endif]--> #center-frame { position: absolute; top: 110px; bottom: 20px; left: 15%; width: 70%; overflow: hidden; height: expression(document.body.clientHeight - 130 + "px"); background-attachment: fixed; background-repeat: no-repeat; text-align: left; color: #988F5E; }

In fact the original code i paste here, is working on all browsers,
cause other than IE browsers will just ignore the line : height: (document.body.clientHeight - 255 + "px");
but it is not W3C standard validated ...

I think the solution would be to maybe wait for IE8 =P

rangana
06-17-2008, 09:04 AM
I once read that functionality first. :p

...and as one of our members say, validation is a means not a goal.