The Web Design Group

4 Reasons to Validate your HTML

Other languages: français

HTML validation allows authors to check their HTML syntax. Valid HTML is less likely to cause problems with different browsers and more likely to survive the next browser release. There are many reasons to validate your HTML, but here we have chosen to focus on historical examples that show why visually checking your Web pages in browsers is not enough. For further discussion, see Site Valet - Why Validate?.

Reason #1: Netscape 1.2

When Netscape 1.1 was released, many authors were delighted to find that they could create animated titles and backgrounds by including multiple <TITLE> and <BODY> tags. Validators flagged these as errors since only one TITLE and BODY is permitted in HTML.

Netscape 1.2 fixed the bug in Netscape 1.1, and multiple <TITLE> and <BODY> tags were ignored. The result on some invalid pages varied from an incomplete or incoherent title to unreadable text.

Reason #2: Netscape 2.0

Netscape 2.0 provided the most stark display of the importance of validation. Prior to Netscape 2.0, the Web's most popular browser quietly corrected an author's missing quotation mark, as in <A HREF="oops.html>Oops</A>. Netscape 2.0 began requiring that closing quotation mark, and at the same time parts of many Web pages began disappearing. Valid HTML survived unscathed.

Reason #3: Netscape 3.0

Netscape 3.0 began looking too hard for entities in attribute values. The result was that unescaped ampersands in attribute values could cause Netscape to use the wrong attribute value. For example, the invalid HTML <A HREF="foo.pl?chapter=1&section=2"> worked fine in versions of Netscape prior to 3.0. But Netscape 3.0 would try to fetch "foo.pl?chapter=1§ion=2" instead of the "right" location. The valid HTML, <A HREF="foo.pl?chapter=1&amp;section=2">, has worked fine in all versions of Netscape.

Reason #4: Netscape 4.0

Netscape 4.0 began requiring the terminating semicolon on entities where previous versions often had not. For example, some HTML tutorials show their expertise with &ltP&gtFoo in examples, which Netscape 4.0 shows literally while previous versions had shown "<P>Foo". Again, valid HTML worked fine in all versions of Netscape.