没有什么意思

我看过很多网站有ie6,ie7,ie8的具体代码。

<!--[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有这样的具体类

<html class=" js no-flexbox flexbox-legacy canvas canvastext webgl no-touch geolocation postmessage websqldatabase indexeddb hashchange history draganddrop websockets rgba hsla multiplebgs backgroundsize borderimage borderradius boxshadow textshadow opacity cssanimations csscolumns cssgradients cssreflections csstransforms csstransforms3d csstransitions fontface generatedcontent video audio localstorage sessionstorage webworkers applicationcache svg inlinesvg smil svgclippaths">

任何一个只是告诉什么是使用此代码


这是Modernizr指令,如果启用了浏览器中的JavaScript, Modernizr运行并将no-js更改为js类,那么您可以为支持javascript的浏览器和针对JavaScript禁用的浏览器定义css样式


它放在那里,这样,如果支持JavaScript,那么你可以使用JS删除no-js类。

如果您的网站通常需要JS才能正常运行,则可以使用no-js类为您的网页设置CSS样式。 如果您想要提供足够的HTML和足够的表单以使页面在没有JS的情况下工作,但这会提供降级但功能的格式,但稍后会隐藏贫民窟版本并将其替换为闪亮和花哨的内容。


<!--[if IE]><![endif]-->是Microsoft的条件注释。

因此,对于IE版本<7( [if lt IE 7] ),使用<html lang="en" class="no-js ie6"> ;

对于IE版本7( [if IE 7] ),使用<html lang="en" class="no-js ie7"> ;

等等。

最后,对于IE版本> 9( [if gt IE 9] ),使用<html lang="en" class="no-js">

由于这是微软的特定评论,所有非IE浏览器都会将其视为普通评论,因此只使用<html lang="en" class="no-js"> (唯一未评论的部分)。

链接地址: http://www.djcxy.com/p/96873.html

上一篇: what is the meaning of no

下一篇: How can I make the browser wait to display the page until it's fully loaded?