简体   繁体   English

html 根元素的 css 类?

[英]css classes for html root element?

i found this code via Google Developer Tools:我通过谷歌开发者工具找到了这段代码:

<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en" class=" js canvas canvastext geolocation crosswindowmessaging websqldatabase no-indexeddb hashchange historymanagement draganddrop websockets rgba hsla multiplebgs backgroundsize borderimage borderradius boxshadow opacity cssanimations csscolumns cssgradients cssreflections csstransforms no-csstransforms3d csstransitions  video audio localstorage sessionstorage webworkers applicationcache svg smil svgclippaths no-opera no-mozilla webkit   fontface">
    </html>

and this code via html source code:此代码通过 html 源代码:

<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en"> </html>

obviously these classes get generated with Javascript.显然这些类是用 Javascript 生成的。 But Why?但为什么? Why so many css classes for html root element?为什么 html 根元素有这么多 css 类?

These get generated by Modernizr , as a means to identify what features are available to a user's browser.这些由Modernizr生成,作为识别用户浏览器可用功能的一种手段。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM