O'Reilly logo

HTML5 & CSS3 For The Real World by Alexis Goldstein, Estelle Weyl, Louis Lazaris

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

Appendix A.  Modernizr

Modernizr is an open source JavaScript library that allows us to test for individual features of HTML5 in our users’ browsers. Instead of testing just for a particular browser and trying to make decisions based on that, Modernizr allows us to ask specific questions like: “Does this browser support geolocation?” and receive a clear “yes” or “no” answer.

The first step to using Modernizr is to download it from the Modernizr site, at http://modernizr.com.

Once you have a copy of the script, you’ll need to include the script file in your pages. We’ll add it to the head in this example:

<!doctype html> <html> <head> <meta charset="utf-8"> <title>My Beautiful Sample Page</title> <script src="modernizr-1.7.min.js"></script> </head> ...

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