为什么Firefox会关闭null html标签? [英] Why is Firefox closing null html tags?

查看:153
本文介绍了为什么Firefox会关闭null html标签?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在Firefox中注意到,当我查看源代码时,它会向null标记项添加结束标记,例如< hr> < img src =image.jpg> 。在Firefox中查看来源我看到< hr>< / hr> < img src =image.jpg>< / IMG> 。该文档是HTML 5而不是XHTML,标签是空标签,不应严格在HTML中关闭。那么为什么Firefox会这样做?

I have noticed in Firefox that when I view source it is adding closing tags to null tag items such as <hr> and <img src="image.jpg">. Viewing source in Firefox I see <hr></hr> and <img src="image.jpg"></img>. The document is HTML 5 and not XHTML, and the tags are null tags which should not strictly be closed in HTML. So why is Firefox doing this?

推荐答案

我猜你不只是使用视图源,而是使用Firefox开发者工具浏览器检查器?这样做是因为每个标签必须结束,因此检查员明确显示此终点。

I'm guessing that you are not just using view source, but are instead using the Firefox Developer Tools Browser Inspector? This is done because there has to be an end to each tag so the inspector is explicitly showing this end point.

这篇关于为什么Firefox会关闭null html标签?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆