Hi All,

I am struggling to get the version of css supported in my browser. Is there any way to get it through javascript.

Thanks

Recommended Answers

All 7 Replies

Never used it myself, but a quick google search lead me to

Modernizr

WHY would you need this info?

All current browsers support css2, no browser supports more than a couple of bits of css3. The latest versions of firefox support a few more bits of css3 than most other browsers, but as css3 is still only at the discussion stage, you should just work with css2, unless you have a specific bit of code that you wish to use and you know the javascript alternative to use for other browsers, or just accept that it will not be displayed in other browsers. Because if the browser can't read your code, it just ignores it.

So, if you really need to know the version of css used, the answer is almost always css2, as css3 hasn't been got past the discussion stage.

@drjohn: First of all thanks for the info. And Why I want to know? Because I want to know.

OK currently CSS2 is used in most of the browsers but how would I now when my browser start supporting CSS3.

You will "now" when your browser starts supporting CSS3 because it will be listed in features or "whats new" when you get a browser update.

@macneato: Thanks for correcting the typo "now" :D.

But still I just want to know is there any way to get it in javascript.

Told you to take a look at Modernizr, link to the website is above. Think its jquery

Current browsers will not change their CSS support, it is only when new releases occur that they will start supporting CSS3. So when Firefox 4 or IE9 comes out, you will read about the new improved level of CSS3 support. But as CSS3 is still at the discussion stage, don't expect anything to change for several years. Just stick to using CSS2 and the odd bits that FF supports, and accept that without adding JS support for a few features, IE8 users (and those with even older versions) will not see the extras you add. It is not a problem in any way. Just don't imagine that your CSS2 designs will suddenly stop working - they will not.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.