• Unitless Line Heights Are Finally Valid

    Jan 15 2007

    It's a miracle! There is a new W3C CSS Validator. I checked, and it's true, Unitless Line Heights are now considered valid!

    Back in February, Eric Meyer wrote about Unitless Line Heights, explaining that you don't need to put px, pt, % or em at the end of a line height, and you don't even need decimals. Unfortunately, for a long time, the W3C CSS validator said that this was invalid:

    body { line-height: 1 }

    Oddly, if you changed it to 1.0, it became valid.

    I took the challenge, and downloaded the Java source code of the validator. After reading through the code for a few hours, I found the problem. At the core of the bug, it was requiring the value to be a Float but not a regular Number.

    Anyway, on February 11th, 2006, I sent in a patch to fix the problem.

    And now, about a year later, the live validator is finally fixed. Now we can all rejoice by having our valid CSS actually validating.

  • Comments

    1. David Laakso at 8:30pm on January 19, 2007

    Great, good for you!

    Might be appreciated to inform css-d, webdesign-l, and wsg (among others).

    2. Panagiotis Karageorgakis at 6:38am on April 17, 2007

    Thank you for taking the time to fix this!

    Commenting is now closed. Come find me on Twitter.