html根元素的css类?

DrS*_*ove 6 html javascript css

我通过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>
Run Code Online (Sandbox Code Playgroud)

这段代码通过html源代码:

<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en"> </html>
Run Code Online (Sandbox Code Playgroud)

显然这些类是用Javascript生成的.但为什么?为什么这么多的hss根元素的CSS类?

new*_*ron 14

这些是由Modernizr生成的,用于识别用户浏览器可用的功能.

  • 当然可以通过网站css (2认同)