Modernizr adds classes to the <html>
element which allow you to target specific browser functionality in your stylesheet. You don’t actually need to write any Javascript to use it.
Modernizr uses feature detection to test the current browser against upcoming features like rgba(), border-radius, CSS Transitions and many more. These are currently being implemented across browsers and with Modernizr you can start using them right now, with an easy way to control the fallbacks for browsers that don’t yet support them.
Additionally, Modernizr creates a self-titled global JavaScript object which contains properties for each feature; if a browser supports it, the property will evaluatetrue
and if not, it will be false
.
Lastly, Modernizr also adds support for styling and printing HTML5 elements. This allows you to use more semantic, forward-looking elements such as<section>
, <header>
and <dialog>
without having to worry about them not working in Internet Explorer.