[英]Why does Chrome Developer Tool add elements not in the file?
When I have a simple HTML markup like this: 当我有一个像这样的简单HTML标记时:
<!DOCTYPE html>
<html>
<head>
<title>lawl</title>
</head>
<body>
</body>
</html>
When viewing the elements of the document, in the Chrome Deceloper Tool(F12) it looks likes this: 查看文档的元素时,在Chrome Deceloper Tool(F12)中看起来像这样:
<!DOCTYPE html>
<html>
<head>
<title>lawl</title>
<style type="text/css"></style> <-- what the?
</head>
<body>
</body>
</html>
So, my question goes: Where does the style tag come from? 因此,我的问题是:样式标签从何而来? What added it, and why?
是什么添加了它,为什么?
Hope you guys can clear this up for us, it's been quite the subject the last 10 minutes in class ;-). 希望你们能为我们解决这个问题,这是课堂上最后10分钟的主题;-)。 Also worth mentioning;
还值得一提; a class got added to a empty div in another document when the teacher tried it.
当老师尝试时,一个班级被添加到另一个文档的空div中。
Edited title. 编辑标题。
Chrome plugins can get access to your DOM, and so does the development tools. Chrome插件可以访问您的DOM,开发工具也可以访问。 In this particular case, I think the development tools is the one to blame.
在这种情况下,我认为应该指责开发工具。
The empty style tag is probably a placeholder for injected CSS. 空样式标签可能是注入CSS的占位符。
If you open the source code ( view-source:www.example.com
), you will see that your DOM is perfectly fine. 如果您打开源代码(
view-source:www.example.com
),您将看到DOM非常完美。
99:1 <style>
元素是您的AdBlock(或类似名称)扩展程序注入的样式表。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.