Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

what is the meaning of no-js class in html5

Tags:

html

css

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

like image 420
raj Avatar asked Sep 28 '12 06:09

raj


2 Answers

This is instruction for Moderniz. If JavaScript in your browser is enabled, Modernizr changes no-js to js class, so you can define CSS styles for JavaScript-enabled browsers and for JavaScript-disabled browsers

like image 128
AuthorProxy Avatar answered Sep 19 '22 00:09

AuthorProxy


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.

like image 29
Norguard Avatar answered Sep 18 '22 00:09

Norguard