现代化 - 如何
嗨,我正在测试 Modernizr,这是我所做的代码,我无法在查看源代码中看到 html 标签中的样式,有人知道为什么吗???
<html class="no-js">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>title</title>
<script type="text/javascript" src="http://www.modernizr.com/downloads/modernizr-latest.js"></script>
</head>
<body>content</body>
Hi I am testing modernizr and this is the code i did and i am not able to see the styles in the html tag in view source, does any one know why ???
<html class="no-js">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>title</title>
<script type="text/javascript" src="http://www.modernizr.com/downloads/modernizr-latest.js"></script>
</head>
<body>content</body>
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
当您查看源代码时,您正在查看文件下载时的实际源代码,而不是在脚本执行之后(至少在现代浏览器中,我似乎记得IE6以某种方式显示基于实时的源代码) DOM)。
如果您使用 FireBug 之类的东西,您可以看到实时源代码,包括
html
上的类元素。When you view source you are viewing the actual source code of the file as downloaded, not after the script has executed (at least in modern browsers, I seem to remember that IE6 somehow showed source based on the live DOM).
If you use something like FireBug you can see the live source, including the classes on the
html
element.