If the web was smaller

July 5, 2008

I’ve just had this crazy idea, what would happen if all the <div> tags in the world were converted into <d> tags. Image how much space it would save, well you don’t need to imagine I have broken out my calculator and worked it all out.

Taking the top 5 website's from Alexa:

Website Number of <div> Elements Size Size when <div> = <d>
Yahoo.com 85 153Kb 152Kb
Google.com 6 7.5Kb 7.5Kb
Youtube.com 377 76.8Kb 75.3Kb
Live.com 27 18.6Kb 18.5Kb
MSN.com 140 48.9Kb 48.3Kb

For every element that would be converted to a <d>, on average 5.93 bytes are saved. Considering that a typically website has 127 <div> elements, taking from the average of the top 5 website's, this will create a saving of 0.753Kb per web page. That might not seem like a lot but added together across all the website's imagine how much time it would save.

Of course this is just pie in the sky, but if the W3C thought of shrinking the HTML tags we use, website's would load faster, and every millisecond counts. Hopefully this will cause some debate on why HTML elements are longer than they need to be.

I am only suggesting the HTML tags div and span since they convey no semantical meaning, unlike elements like p.


comments powered by Disqus