what is the meaning of no

i seen lot of website have specific code for 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]-->

and i seem html have specific class like this

<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">

any one just tell what is the use this codes


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


It's put there so that if there IS Javascript support, then you can use JS to remove the no-js class.

You use the no-js class to style CSS for your webpage if you normally require JS for your site to function properly. This provides a degraded but functional format, if you want to serve enough HTML and enough forms to make the page work without JS, but then hide the ghetto-version and replace it with the shiny and fancy stuff, later.


<!--[if IE]><![endif]--> is Microsoft's conditional comment.

So for IE version < 7 ( [if lt IE 7] ), <html lang="en" class="no-js ie6"> is used;

For IE version 7 ( [if IE 7] ), <html lang="en" class="no-js ie7"> is used;

and so on.

Finally, for IE version > 9( [if gt IE 9] ), <html lang="en" class="no-js"> is used.

And since it is a Microsoft specific comment, all non-IE browsers will treat it as normal comment, so only <html lang="en" class="no-js"> (the only un-commented part) is used.

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

上一篇: PHP&<noscript>组合在浏览器中检测启用的JavaScript

下一篇: 没有什么意思