Question

I wanna use the www.modernizr.com project for my site and run into a little question. A comment in the very beginning of the modernizr.js tells me:

Modernizr tests which native CSS3 and HTML5 features are available in the current UA and makes the results available to you in two ways: as properties on a global Modernizr object, and as classes on the html element. This information allows you to progressively enhance your pages with a granular level of control over the experience.

So what means "as classes on the html element" ? I tested it and just use the header element (which is HTML5) in my document and manipulate it via css. After that i opened it with IE6 and ......YEA it shows correct!

So: I thought header is and "element" of html not a class of html!? So is this comment in the modenizr.js correct?

Hope you understand my little (or maybe hard to understand) question :)

Regards

Was it helpful?

Solution

What modernizr does is, depending on what your browser support, add classes to the <html> element to let you know (mostly via CSS or even JS) what exactly seems to work properly.

That means, that if my browser doesn't support javascript, I'll get something like this if I inspect the DOM (using, for example, Chrome's profiler)

<html class="no-js ...">...</html>

Hope this helps.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top