News for hackers. Stuff that matters.
Re:Why You Should Design Fixed-Width Websites by ars on Wednesday February 18, 2009 @08:03PM (#486497)
Actually for IE6/7 do:

  width: expression(
      document.body.clientWidth >
        35 * parseInt(document.body.currentStyle.fontSize)
      ?
        "35em"
      :
        (document.body.clientWidth <
          15 * parseInt(document.body.currentStyle.fontSize)
        ?
          "15em"
        :
          "auto"
        )
  ;
(Hope the indenting is readable.)

http://www.gunlaug.no/contents/wd_additions_14.html for some caveats and other notes, in particular you can not specify a font-size at all for the body element (if you do, then do the math yourself and not in the expression).

There are no comments on this comment yet.