HTML文档或CSS树的深度有限制吗?

时间:2022-03-02 20:28:23

I've been wondering this for a while, because I've got some pretty deep HTML structures going on. My points are these:

我一直在思考这个问题,因为我有一些非常深入的HTML结构。我的观点是:

  • Is there a maximum limit to the number of nesting levels for HTML?
  • HTML的嵌套级别的数量有最大限制吗?
  • Likewise with CSS - I need to select stuff from the leaf nodes of the HTML DOM tree?
  • 同样的CSS——我需要从HTML DOM树的叶子节点中选择东西?
  • Is it browser dependent?
  • 它是依赖于浏览器吗?

Thanks for any help,

感谢任何帮助,

James

詹姆斯

3 个解决方案

#1


2  

Neither the XHTML 1.0 nor the HTML 4.01 specification defines a nesting limitation. HTML5 is not yet standardized, but the working spec does not reference a limitation.

XHTML 1.0和HTML 4.01规范都没有定义嵌套限制。HTML5还没有标准化,但是工作规范没有引用限制。

The CSS 2 spec similarly contains no limit.

CSS 2规范同样没有限制。

Browser-based limitations may be an issue in the future, but I was unable to find any problem reports with modern browsers.

基于浏览器的限制在未来可能是一个问题,但是我无法用现代浏览器找到任何问题报告。

#2


8  

I'm going to lean toward no limit that I'm aware of. You should check this one out: http://www.geeksaresexy.net/2009/09/01/a-hidden-gem-in-html/. The site is nested deeply enough to recreate a skyline using font tags.

我将向我所知道的无限倾斜。您应该检查一下这个:http://www.geeksaresy.net/2009/09/01 /a-hidden- gemin -html/。这个网站嵌套的很深,可以使用字体标签重新创建一个天际线。

#3


2  

I think you'll hit memory limitations before you hit any DOM restrictions (if any exist; I believe they don't).

我认为在遇到任何DOM限制之前(如果存在的话;我相信他们不会)。

#1


2  

Neither the XHTML 1.0 nor the HTML 4.01 specification defines a nesting limitation. HTML5 is not yet standardized, but the working spec does not reference a limitation.

XHTML 1.0和HTML 4.01规范都没有定义嵌套限制。HTML5还没有标准化,但是工作规范没有引用限制。

The CSS 2 spec similarly contains no limit.

CSS 2规范同样没有限制。

Browser-based limitations may be an issue in the future, but I was unable to find any problem reports with modern browsers.

基于浏览器的限制在未来可能是一个问题,但是我无法用现代浏览器找到任何问题报告。

#2


8  

I'm going to lean toward no limit that I'm aware of. You should check this one out: http://www.geeksaresexy.net/2009/09/01/a-hidden-gem-in-html/. The site is nested deeply enough to recreate a skyline using font tags.

我将向我所知道的无限倾斜。您应该检查一下这个:http://www.geeksaresy.net/2009/09/01 /a-hidden- gemin -html/。这个网站嵌套的很深,可以使用字体标签重新创建一个天际线。

#3


2  

I think you'll hit memory limitations before you hit any DOM restrictions (if any exist; I believe they don't).

我认为在遇到任何DOM限制之前(如果存在的话;我相信他们不会)。