Is it OK to implement Modernizr with Twitter Bootstrap?
I'm currently using Bootstrap with Google's html5shiv and I wanted to know if I can use Modernizr instead or is it overkill just to get HTML5 elements activated for older IE browsers?
Thanks in advance
The reason we recommend placing Modernizr in the head is two-fold: the HTML5 Shiv (that enables HTML5 elements in IE) must execute before the <body> , and if you're using any of the CSS classes that Modernizr adds, you'll want to prevent a FOUC.
Modernizr provides an easy way to detect any new feature so that you can take corresponding action. For example, if a browser does not support video feature then you would like to display a simple page.
Modernizr is a JavaScript library that detects which HTML5 and CSS3 features your visitor's browser supports. In detecting feature support, it allows developers to test for some of the new technologies and then provide fallbacks for browsers that do not support them.
What is Modernizr? Modernizr is a small piece of JavaScript code that automatically detects the availability of next-generation web technologies in your user's browsers.
Modernizr is a test suite that adds feature detection via classes applied to the body tag. It includes HTML5Shi(v|m) to add older browser compatibility. You don't need Modernizr just to style new tags in older browsers.
That said, it is OK to include Modernizr with Twitter Bootstrap. You can even get an auto-generated H5BP template with Bootstrap and Modernizr included at Initializr.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With