HTML5 and CSS3 with Modernizr

Home / Technology / HTML5 and CSS3 with Modernizr

Ten years ago, browser support for CSS layouts was wonky overall.  Designers and developers advocated for web standards compliance, while creating hundreds of hacks that made CSS layouts work in all browsers. Today, CSS-based layouts are commonplace and every browser has pretty solid support for them. But now the situation of browser compliance is repeating itself with HTML5 and CSS3.

To solve that problem, you can use Modernizr. Modernizr is an open-source JavaScript library allows web developers to support capabilities of the visitor’s browser at different levels. This enables developers to take advantage of everything in HTML5 and CSS3 that is implemented in some browsers, without losing control over the end result in other (older) browsers.

When you embed the Modernizr script in your page, it detects whether the current browser supports CSS3 features like @font-face, border-radius, border-image, box-shadow, rgba() and so forth, as well as HTML5 features like audio, video, localStorage, and the new <input> element types and attributes. It provides a script loader so you can pull in polyfills to backfill functionality in old browsers.

Sounds like a magical solution? Yes and no, for those developers who aren’t familar with using Modernizr, HTML5 or CSS3 it could take twice as long to develop a site this way, which can be seen as a major downfall. However, the learning curve is worth the time invested when looking at the big picture.


Leave a Comment

nineteen + 4 =