1

How can I test the browser that css3 is supported or not?

if(!css3){
//if at least one css3 feature isn't supported
//do stuff here
}
Bhojendra Rauniyar
  • 83,432
  • 35
  • 168
  • 231
  • 2
    This might help you out http://stackoverflow.com/q/1342994/1696560 – Anton Mar 10 '14 at 08:49
  • http://modernizr.com/ –  Mar 10 '14 at 08:50
  • you won't be able to, But you can try [`modernizr`](http://www.modernizr.com/) – Dhaval Marthak Mar 10 '14 at 08:50
  • CSS3 is not really something you can test for all at once. Write appropriate CSS. Write appropriate fallbacks. JavaScript-based detection of anything just kind of ends in sadness. – Ry- Mar 10 '14 at 08:50
  • 1
    CSS3 is not a single 'thing' that browsers implement, it's a collection of standards, I don't think *any* browser *fully* implements CSS3; only parts of it. You want to test for the parts you're using. – Martin Tournoij Mar 10 '14 at 08:51
  • This might help http://www.sitepoint.com/detect-css3-property-browser-support/ – Sachin Jain Mar 10 '14 at 08:52

2 Answers2

1

Try to assign a CSS3 property (that's relevant to what you're doing - no sense testing transition if you're actually just doing transform), andthen immediately check to see if the value "stuck". If the browser supports what you gave it, it will stick. Otherwise, it will change back to an empty string.

Niet the Dark Absol
  • 320,036
  • 81
  • 464
  • 592
1

No browser supports all the features of CSS3 but some of the features are supported by browsers.

You may check this:-

We now have HTML5 and CSS3. No browser supports every feature so it’s often necessary to include shims or use detection techniques to ensure cross-browser compatibility

Rahul Tripathi
  • 168,305
  • 31
  • 280
  • 331
  • Personally, I generally don't bother with vendor prefixes. Most of the time, CSS3 features are eye candy, and therefore browser support is not essential. Does it really matter if users of IE8 get square borders instead of rounded ones? – Niet the Dark Absol Mar 10 '14 at 09:10