Modernizr uses feature detection, rather than checking the browser's property, to discern what a browser can and cannot do. It considers feature detection more reliable since the same rendering engine may not necessarily support the same things in two different browsers using that engine. In addition, some users change their user agent string to get around websites that block features for browsers with specific user agent settings, despite their browsers having the necessary capabilities. Modernizr offers tests for more than 250 features, then creates a
JavaScript object (named "Modernizr") that contains the results of these tests as
boolean properties. It also adds classes to the
HTML element based on what features are and are not natively supported. To perform feature detection tests, Modernizr often creates an element, sets a specific style instruction on that element and then immediately tries to retrieve that setting.
Web browsers that understand the instruction will return something sensible; browsers that do not understand it will return nothing or "undefined". Modernizr uses the result to assess whether that feature is supported by the web browser. Many tests in the documentation come with a small code sample to illustrate how a specific test can be used in web development
workflow. ==Running==