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

Valid way to target CSS at Safari only?

  • # March 5, 2009 at 2:48 pm

    Does anyone know of a valid way to send certain CSS styles to Safari only?

    I’ve been playing around with the new Safari 4 beta and its support for CSS transitions. I added some transitions to my site, but since the property (-webkit-transition) isn’t an approved standard yet, it doesn’t validate. Other than the transitions, the rest of my stylesheet is valid.

    Is there a way to apply the -webkit-transition stuff only to Safari, so that I can send 100% valid code to other browsers that can’t display the transitions? All the methods I’ve seen to target Safari rely on invalid hacks, which would be pointless – in that case, I could just send -webkit-transition to all browsers like I am now.

    Times like this, I wish conditional comments worked for all browsers :lol:

    # March 5, 2009 at 4:30 pm

    Don’t worry about it. If the only validation errors are for -webkit or -moz then just let it be. There’s no point in getting anal about validation.

    Nobody is going to be checking your site and reporting you to the CSS monitor :mrgreen:

    # March 5, 2009 at 11:08 pm

    Dave is exactly right. Really, seriously, don’t worry about it. Validation doesn’t mean anything; it doesn’t affect anything. You should use browser extentions to yours hearts content. That’s what they are there for!

    # March 6, 2009 at 6:26 am

    And just to say – the reason you hear alot about people using validation is mostly because it can be a good way to debug across browsers. Validating can pick out something you overlooked :) Until ALL the browsers *looks at IE* work by the same rule book, then validation is always going to be an issue :)

    # March 6, 2009 at 2:41 pm

    This reply has been reported for inappropriate content.

    Also, HTML validation is usually much more important for debugging. If you have an error in your CSS file, you probably need to go back and learn a little more.

Viewing 5 posts - 1 through 5 (of 5 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