I have several div elements for charts. Yslow is saying to reduce DOM elements.
Can i use:
<span class="col1 left"></span><span class="col2 center"></span><span class="col3 right"></span>
instead of:
<div class="col 1 left"></div><div class="col2 center"></div><div class="col3 right"></div>
to reduce DOM elements, or is span a DOM element too?
I’ve got about 900 in total so far. Any ideas or suggestion is greatly appreciated.
spanis a DOM element too. So for the number of DOM elements, it won’t make a difference. To reduce the number of DOM elements, you’d need to consider whether each element is really necessary.Can you also create the same visual page with different HTML? Using less elements will make it clear and easier to read. Perhaps you’re complicating things too much by adding extra elements that are not really needed.