Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Modernizr not applying classes to html-tag

I'm building a website at the moment, where I need the use of Modernizr, but for some reason it doesn't apply the classes to the html-tag as it should..

My code looks like this:

<!doctype html>
<!--[if lt IE 7]><html class="no-js ie6 oldie" lang="en"><![endif]-->
<!--[if IE 7]><html class="no-js ie7 oldie" lang="en"><![endif]-->
<!--[if IE 8]><html class="no-js ie8 oldie" lang="en"> <![endif]-->
<!--[if gt IE 8]><!--><html class="no-js" lang="en"><!--<![endif]-->
<head>
<script src="http://cdn.hosting4real.com/js/modernizr/modernizr.js"></script>
</head>

Anyone that knows how to get it working?

Best regards,

like image 825
LucasRolff Avatar asked Oct 20 '11 11:10

LucasRolff


People also ask

How you can use modernizr in HTML5?

Download the Modernizr library file and then add that file to the script tag of your HTML page. Example: In this example, We will check whether our browser supports HTML5 video or not using Modernizr.

What is script modernizr?

Modernizr is a JavaScript library that detects the features available in a user's browser. This lets web pages avoid unsupported features by informing the user their browser isn't supported or loading a polyfill.

Why do I need modernizr?

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.


1 Answers

View source shows (unsurprisingly) the source code for the page. It doesn't show a live view of the current state of the DOM. If you want that, use a DOM viewer (you'll find one built into most browsers and via the Firebug plugin for Firefox).

like image 168
Quentin Avatar answered Oct 13 '22 02:10

Quentin