Jim Westergren
Web Entrepreneur
Example of bloated HTML in 2012
It is disappointing to see bloated HTML by an established Premium WordPress theme developer in 2012. I bought the theme and I am now taking out all the bloat.
Here is how the quote looks like before and after.
HTML
<!-- Their version -->
<div class="hot">
<div class="hot_con">
<div class="hot_con_txt">
Here comes the text of a quote.
</div>
</div>
</div>
<!-- My version -->
<blockquote>Here comes the text of a quote.</blockquote>
CSS
/* Their version */
.hot {
width:960px;
margin:30px auto 0;
background:url(images/index_37.jpg) 0 0 repeat-x;
}
.hot_con {
background:url(images/quotes.png) 15px 3px no-repeat;
}
.hot_con_txt {
background:url(images/index_37.jpg) bottom left repeat-x;
padding:15px 60px;
line-height:1.5em;
font-size:18px;
}
/* My version */
blockquote {
padding:15px 10px 15px 60px;
line-height:1.5em;
font-size:18px;
width:900px;
margin:30px auto;
background:url(images/quotes.png) 10px 10px no-repeat;
border-top:1px #aaa dashed;
border-bottom:1px #aaa dashed;
}
Additionally it is 2 less images meaning 2 less HTTP requests to be made by the browser.
What do you think?
Few of my projects:
Latest on my blog:
- My Recommendations for a Happy Life
- Budget 100 - an old school magic format
- My Favorite Board Games and How I Play Them
- Switching from Windows PC to Mac and why I switched back
- Creating The Space War - The Card Game of My Dreams
- 24 Characteristics That Geniuses Have in Common
- Setting up and Managing a MySQL Server