在单个页面中有多个html,head和body元素可以吗? [英] Is it OK to have multiple html, head, and body elements in single page

查看:355
本文介绍了在单个页面中有多个html,head和body元素可以吗?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有多个页面一起被拉到一个页面。这些单独的页面中的一些具有它们自己的html,head和body元素。有没有这些页面的性能是不利的?看来,在FireBug中DOM是正确的(只有一个元素)。

解决方案

这样做。



浏览器对于解析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屋!

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