Results 1 to 4 of 4

Thread: IE css expression , and valide W3C no solution ?

  1. #1
    Join Date
    Apr 2008
    Posts
    58
    Thanks
    22
    Thanked 0 Times in 0 Posts

    Default IE css expression , and valide W3C no solution ?

    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 ??

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

  2. #2
    Join Date
    Feb 2008
    Location
    Cebu City Philippines
    Posts
    1,160
    Thanks
    17
    Thanked 277 Times in 275 Posts

    Default

    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:
    Code:
    <!--[if IE]>
    #left-side-frame
    {
    height: (document.body.clientHeight - 255 + "px"); /* IE fix */
    }
    <![endif]-->
    Learn how to code at 02geek

    The more you learn, the more you'll realize there's much more to learn
    Ray.ph!

  3. The Following User Says Thank You to rangana For This Useful Post:

    sfchun (06-17-2008)

  4. #3
    Join Date
    Apr 2008
    Posts
    58
    Thanks
    22
    Thanked 0 Times in 0 Posts

    Default

    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
    Last edited by sfchun; 06-17-2008 at 08:39 AM.

  5. #4
    Join Date
    Feb 2008
    Location
    Cebu City Philippines
    Posts
    1,160
    Thanks
    17
    Thanked 277 Times in 275 Posts

    Default

    I once read that functionality first.

    ...and as one of our members say, validation is a means not a goal.
    Learn how to code at 02geek

    The more you learn, the more you'll realize there's much more to learn
    Ray.ph!

  6. The Following User Says Thank You to rangana For This Useful Post:

    sfchun (06-17-2008)

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •