Modernizr – detecting HTML5 and CSS3 support in browswers

by Raju Bitter on October 16, 2009

Have you ever been dealing with detecting support for the new HTML5 and CSS3 features in browsers? Check out Modernizr, an open source JavaScript library which will probably make things a lot easier for you:

Modernizr is a small and simple JavaScript library that helps you take advantage of emerging web technologies (CSS3, HTML 5) while still maintaining a fine level of control over older browsers that may not yet support these new technologies.

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.

Using Modernizr within your CSS style sheets is very easy:


.multiplebgs div p {
/* properties for browsers that
support multiple backgrounds */
}
.no-multiplebgs div p {
/* optional fallback properties
for browsers that don't */
}

The approach Modernizr takes is not to assume what features the current browser supports based on the result of a user agent string analysis. Instead it uses feature detection for 20 innovative HTML5 and CSS3 features.

Share:
  • Print this article!
  • Digg
  • del.icio.us
  • Facebook
  • Google Bookmarks
  • StumbleUpon
  • E-mail this story to a friend!
  • Ping.fm
  • Twitter

{ 1 trackback }

Modernizr – detecting HTML5 and CSS3 support in browswers | My Blog
November 25, 2009 at 22:13

{ 0 comments… add one now }

Leave a Comment

You can use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>

Previous post: OpenLaszlo & Open Web – Rounded Corners in SWF10 and DHTML

Next post: Adobe – Flash Player FP-40 bug will be fixed with the release of 10.1