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.










{ 1 trackback }
{ 0 comments… add one now }