05 Jun 2007

CSS browser detection

Tags: , ,

Now we all know that making browser-specific css rules is a bad practice. But sometimes it can save a lot of nerves and code. It’s why we all love those CSS Filters tables. They give us some basic information on what works and what doesn’t in which browser. But we still have to determine just which rules to combine for a specific browser.

So I created a little demo case where I apply a certain css rule only to one browser at a time. Or to the viewer… it tells you what browser you are using - css only. It’s valid CSS 3 (with 2 warnings) and the code is documented so you can see what I did.

CSS browser detection - see for yourself

Please notify me of anything not showing correctly or if you think I should add a certain browser to the table.

3 Responses to “CSS browser detection”

  1. Jure / Jun 13, 2007 4:24 am

    It’s giving interesting results in Safari 3

  2. Dušan Smolnikar / Jun 13, 2007 10:18 am

    Hmm, you’re right. I’ll see what’s going on and try to fix it.

  3. Dušan Smolnikar / Jun 13, 2007 7:09 pm

    Problem solved. It seems they did tweak css rendering a bit, fixing some bugs and adding better support to some selectors. Yet again, I’m surprised by just how much css konqeuror supports (and I have konqueror 3.9 from 2005)

Leave a Reply