O'Reilly logo

Learning Modernizr by Adam Watson

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Focusing on features, not browsers

Hopefully by now you're starting to get the idea of how feature detection differs from the traditional way of browser (User Agent) sniffing, and how you can use that to your benefit.

Modernizr doesn't ever ask the question, is this Internet Explorer 8, or is this Firefox 13? Instead it asks the question, is there support for a particular feature? Is there CSS gradient support? Is there multiple background image support?

Features can be predicted in parts because although not a finalized specification, HTML5 has been adopted as a new standard by all the major browser manufacturers. That's right, all manufacturers, even Internet Explorer. You can bet that feature detection is a world more reliable than UA sniffing ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required