You are previewing HTML5 & CSS3 For The Real World.

HTML5 & CSS3 For The Real World

Cover of HTML5 & CSS3 For The Real World by Louis Lazaris... Published by SitePoint

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

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

The best content for your career. Discover unlimited learning on demand for around $1/day.