Chapter 23. Tidying and Validating your Documents

IN THIS CHAPTER

  • Tidying your HTML code

  • Validating your code

  • Additional testing and validation

After creating your documents, it is important to test them to ensure that visitors to your site will not encounter any unforeseen problems. This chapter covers the basics of testing your code, including what tools are at your disposal.

Tidying Your HTML Code

One important step while developing HTML documents is to keep the code tidy. Tidy code is code that is kept orderly with logical line breaks and intelligent indentation. Although this doesn't seem like a crucial issue, it takes only small snippets of code to see the difference, as illustrated in Listings 23-1 and 23-2.

Example 23-1. Untidy code

<table border="1" rules="all">
<tr><td><img src="./images/JillHennessy.jpg" width="100px"
height="150px" alt="Jill" /><br />Jill Hennessy</td><td>Jill is
the founder of the Oasis of Tranquility and its executive
officer. She oversees the business side of the spa and operates
as its chief recruiting officer. Jill has degrees in business
and cosmetology.</td></tr><tr><td><img
src="./images/SandraBrown.jpg" width="100px" height="150px"
alt="Sandra" /><br />Sandra Brown</td><td>Sandra is the
co-founder of the Oasis and its operating officer. She is
responsible for the day-to-day operation of the spa and
management of its employees. Sandra has journalism and
management degrees and several accreditations from various
cosmetology schools.</td></tr><tr><td><img ...

Get HTML, XHTML, and CSS Bible, Fourth Edition now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.