Close any
tags it determines are left open, for example, and recode tags that it determines are being incorrectly nested (such as
block elements inside inline elements). In short, you do want to ensure that your page is well-formed. However, valid is
another story.
For example, in order to use Peter-Paul Koch??™s excellent JavaScript code that reveals additional parts of a form as the
user makes selections (see http://www.quirksmode.org/dom/usableforms.html), you must add a rel attribute to each
of the divs that hold the elements to be revealed. rel tags are not valid attributes for divs, and the page no longer
passes validation, but the document can still be well-formed, so I am OK with letting that error go in exchange for added
functionality. Some purists insist that every page must pass validation, but if it fails because of minor ???valid??? errors like
this and is still well-formed, I think it??™s OK to ignore that advice.
Looking forward to the email I??™m going to get on this one...
Here??™s the complete (and mercifully, short) list of the coding requirements
for XHTML compliance:
1. Declare a DOCTYPE. The DOCTYPE goes before the opening
html tag at the top of the page and tells the browser whether the
page contains HTML, XHTML, or a mix of both, so that it can
correctly interpret the markup. There are three main DOCTYPEs
that let the browser know what kind of markup it is dealing with:
Strict: All markup is XHTML-compliant.
Pages:
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38