The Lodge is members-only design/dev videos and Office Hours.

Next Office Hours Session: "Implementing an SVG Icon System" Nov 30 - 6:00 PM Eastern

How important is valid CSS?

  • # October 16, 2012 at 1:42 pm

    When considering the ‘zoom:1’ idea for clearfix’s, I’ve been conditionally been including a tiny CSS file for browsers < IE9. If left in the main css file, it works without issue, but does not validate. Other than being anal, how does validation effect css and the performance of a website? (excuse me if this is uber-newb!)

    # October 16, 2012 at 3:00 pm

    This reply has been reported for inappropriate content.

    You don’t really need to worry about it. See validation as a way of spotting errors rather than getting a “perfect score”. Properties, etc everyone uses, such as vendor prefixed properties, cause the validator to return errors. So as long as your invalid properties are justifiably invalid and not made up properties/errors/etc, you’ll be ok.

    It’s good to be finicky about these sort of things, but don’t worry too much about CSS validation.

    Validation is a very important tool when trying to debug. (For every time I validate my css I probably validate my html 25 times).

    # October 17, 2012 at 6:19 am

    I think the cleaner your CSS is, the faster it will be for the browser’s CSS parser.

    But I wouldn’t chase the perfect score if I were you. Firstly because a single line of CSS3 would make this impossible, and mostly because it has no point, contrary to valid markup.

    # October 18, 2012 at 4:01 pm

    This reply has been reported for inappropriate content.

    Thanks guys :)
    Nice to see I’m thinking the same way that others are.

Viewing 4 posts - 1 through 4 (of 4 total)

You must be logged in to reply to this topic.

There's a whole bunch of content on CSS-Tricks.

Search for Stuff   •   Browse the Archives

Get the Newsletter ... or get the RSS feed