What is the purpose of the HTML “no-js” class?

后端 未结 7 1185
误落风尘
误落风尘 2020-11-27 08:59

I notice that in a lot of template engines, in the HTML5 Boilerplate, in various frameworks and in plain php sites there is the no-js class added onto the

7条回答
  •  眼角桃花
    2020-11-27 09:26

    When Modernizr runs, it removes the "no-js" class and replaces it with "js". This is a way to apply different CSS rules depending on whether or not Javascript support is enabled.

    See Modernizer's source code.

提交回复
热议问题