1,105,334 Community Members

How to get CSS version number for a particular browser.

Member Avatar
Luckychap
Posting Pro in Training
451 posts since Aug 2006
Reputation Points: 68 [?]
Q&As Helped to Solve: 62 [?]
Skill Endorsements: 0 [?]
 
0
 

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

Member Avatar
macneato
Posting Pro in Training
415 posts since Jun 2007
Reputation Points: 29 [?]
Q&As Helped to Solve: 48 [?]
Skill Endorsements: 0 [?]
 
0
 

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

Modernizr

Member Avatar
drjohn
Posting Pro
526 posts since Mar 2010
Reputation Points: 50 [?]
Q&As Helped to Solve: 106 [?]
Skill Endorsements: 4 [?]
 
0
 

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.

Member Avatar
Luckychap
Posting Pro in Training
451 posts since Aug 2006
Reputation Points: 68 [?]
Q&As Helped to Solve: 62 [?]
Skill Endorsements: 0 [?]
 
0
 

@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.

Member Avatar
macneato
Posting Pro in Training
415 posts since Jun 2007
Reputation Points: 29 [?]
Q&As Helped to Solve: 48 [?]
Skill Endorsements: 0 [?]
 
0
 

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.

Member Avatar
Luckychap
Posting Pro in Training
451 posts since Aug 2006
Reputation Points: 68 [?]
Q&As Helped to Solve: 62 [?]
Skill Endorsements: 0 [?]
 
0
 

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

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

Member Avatar
macneato
Posting Pro in Training
415 posts since Jun 2007
Reputation Points: 29 [?]
Q&As Helped to Solve: 48 [?]
Skill Endorsements: 0 [?]
 
0
 

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

Member Avatar
drjohn
Posting Pro
526 posts since Mar 2010
Reputation Points: 50 [?]
Q&As Helped to Solve: 106 [?]
Skill Endorsements: 4 [?]
 
0
 

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.

You
This article has been dead for over three months: Start a new discussion instead
Post:
Start New Discussion
View similar articles that have also been tagged: