admin管理员组

文章数量:1306170

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=".js"></script>
</head>

Anyone that knows how to get it working?

Best regards,

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./js/modernizr/modernizr.js"></script>
</head>

Anyone that knows how to get it working?

Best regards,

Share Improve this question asked Oct 20, 2011 at 11:36 LucasRolffLucasRolff 1,2983 gold badges11 silver badges21 bronze badges 2
  • What classes is it failing to apply? How are you determining that it is not doing so? What browsers are you testing in? – Quentin Commented Oct 20, 2011 at 11:38
  • It doesn't apply any classes at all, only the no-js, I'm testing it in 'view source' in chrome, safari, and opera – LucasRolff Commented Oct 20, 2011 at 11:48
Add a ment  | 

1 Answer 1

Reset to default 10

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).

本文标签: javascriptModernizr not applying classes to htmltagStack Overflow