Recommendations

Lighthouse
Metrics
Audits
PageSpeed (Legacy)
YSlow (Legacy)

YSlow: Reduce the number of DOM elements

Overview

A complex page means more bytes to download, and it also means slower DOM access in JavaScript.

How does your site score on this recommendation?

Details from Yahoo!

Reduce the number of DOM elements on the page to improve performance.

Read our Lighthouse documentation to learn more about avoiding an excessive DOM size.

Summary

Content
Low
Moderate
94%

YSlow recommends:

A high number of DOM elements can be a symptom that there's something that should be improved with the markup of the page without necessarily removing content.

Here are a few questions you should ask yourself:

  • Are you using nested tables for layout purposes?
  • Are you throwing in more <div>s only to fix layout issues?
  • Is there a better and more semantically correct way to do your markup?

A great help with layouts are the YUI CSS utilities: grids.css can help you with the overall layout, fonts.css and reset.css can help you strip away the browser's defaults formatting. This is a chance to start fresh and think about your markup, for example use <div>s only when it makes sense semantically, and not because it renders a new line.

Read More

Cookie Policy

By clicking "Allow All" you agree to the storing of cookies on your device to enhance site navigation, analyze site usage, and assist in our marketing efforts. View cookie details

Deny Allow All
×