在单个页面中有多个html,head和body元素可以吗? [英] Is it OK to have multiple html, head, and body elements in single page
问题描述
这样做。
浏览器对于解析HTML是非常宽容的,因此firefox在您的DOM中有一个有效的DOM案件。拥有多个html,body和head标记不会影响页面解析的性能。但请注意,浏览器将会以怪异的模式运行,并影响你的任何元素的渲染。
反正这是完全违反任何标准的,你应该避免产生这样的页面。有些浏览器可能会拒绝显示您网站的任何内容。例如,这可能是一些浏览器,例如文本浏览器,或者是旧手机上的轻量级浏览器。
I have multiple pages being pulled together into a single page. Some of these individual pages have their own html, head, and body elements. Is it detrimental to the performance of the page to have these? It seems that the DOM is correct (only has a single of each element) in FireBug.
First: don't do that.
Browsers are very tolerant if it comes to parse HTML, therefore firefox has a valid DOM in your case. Having multiple html, body and head tags does not affect the performance of the page parsing. But be aware that the browser will propably run in a quirks mode and affect the rendering of any of your elements.
Anyways this is totally against any standards and you should avoid producing such pages. Some browsers could possibly reject to display anything of your site. That may be some browsers you havent thought of, a text browser, or a lightweight browser on a older mobile phone for example.
这篇关于在单个页面中有多个html,head和body元素可以吗?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!