我注意到,在许多模板引擎中,在HTML5 Boilerplate中,在各种框架中,在纯php站点中,都有no-js类添加到<HTML>标记中。

为什么要这么做?是否有某种默认的浏览器行为对这个类做出反应?为什么总是包括它?如果没有no-“no-js”情况和html可以直接寻址,这不会使类本身过时吗?

下面是一个来自HTML5 Boilerplate index.html的例子:

<!--[if lt IE 7 ]> <html lang="en" class="no-js ie6"> <![endif]-->
<!--[if IE 7 ]>    <html lang="en" class="no-js ie7"> <![endif]-->
<!--[if IE 8 ]>    <html lang="en" class="no-js ie8"> <![endif]-->
<!--[if IE 9 ]>    <html lang="en" class="no-js ie9"> <![endif]-->
<!--[if (gt IE 9)|!(IE)]><!--> <html lang="en" class="no-js"> <!--<![endif]-->

如您所见,<html>元素总是有这个类。 有人能解释一下为什么这种情况如此频繁吗?