开发者

Is deep divs nesting hitting performance?

I've started using DOM Monster, which is in general pretty cool and helpful. One of the warnings it gave me while analyzing a page I've built is that I have elements nested too deeply (more than 15 levels deep).

How badly is div nesting hitting performance of browsers? Should I pu开发者_开发技巧t a major effort into minimizing nesting?


It won't be a problem with modern browsers.

It shouldn't affect IE6 much - you should take into account a total number of div (elements, in general) as it will have more impact than just nesting of 20 elements. I've seen IE6 struggle with rendering ~1000 divs with smaller nesting.

In general I would advise rendering as little elements as possible, since this will help you with styling using CSS.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜