HTML and CSS Reference
In-Depth Information
Modernizr (see ) is a JavaScript library that makes it very easy to
do just that: it detects the availability of various HTML5 and CSS3 features within a
user's browser and allows you to create fallbacks when a desired feature isn't currently
supported (see Figure 2-4 ).
Figure 2-4. The Modernizr site
Using Modernizr
To see how Modernizr works, let's run through an example using the JavaScript library
where we create an audio player using HTML5's audio tag. If the user is viewing the
page with a browser that doesn't support the audio element, we want to display an error
message alerting the user of the problem.
Search WWH ::

Custom Search