HTML is still the lingua franca for publishing hypertext documents on the web. With simple markup tags like <h1> and </h1> used to denote structure, HTML has become the universal language of the web. As designers and browser manufacturers morphed HTML into the web equivalent of PageMaker, however, HTML code became too verbose with presentational tags, scripts, and objects intermixed with structural markup. This chapter and the ones that follow show you how to optimize and simplify your code for maximum speed, while still maintaining the functionality and visual appeal of your site.
Because it has looser rules, HTML offers more opportunities for optimization than its newer cousin, XHTML. In HTML, you can omit some end tags and abbreviate attributes and still have a valid document. In XHTML, every tag must be closed, every attribute fully qualified and quoted. Because HTML offers more opportunities for savings and it isn't going away anytime soon, it is the focus of this chapter. Chapter 5, "Extreme XHTML," focuses on optimizing XHTML, which can use a subset of the techniques discussed here.