-
All tags must be lowercase.
example:
incorrect<div>some content</DIV>
correct<div>some content</div> -
All tags must be nested properly.
example #1:A couple putting their luggage in their car realise they forgot something.
example #2:
To get this item from their closet they have to: open their front door, open the closet door, retrieve what was forgotten, close the closet door, close their front door.
Waiting until after they are outside to close the closet door is not possible. But that is what a lot of people did before XHTML. They would open an outside tag, open a inner tag, close the outside tag, then close the inner tag. This sometimes caused problems in browsers and was generally difficult to understand.
incorrect<span><i>some content</span></i>
correct<span><i>some content</i></span> -
Web pages must be well formed. This means including the html, head, and body tags
in the proper order.
( For an example go to: The Basics / Page Outline ) -
All tags must be closed.
example #1:
incorrect<input type="text" name="example" id="example">
correct<input type="text" name="example" id="example" />
example #2:
incorrect<p>correct
A whole bunch of text to demonstrate the incorrect use of the paragraph tag. Some more text to make sure this looks like a paragraph.
<p><p>
A whole bunch of text to demonstrate the correct use of the paragraph tag. Some more text to make sure this looks like a paragraph.
</p>
- A web page should contain a DOCTYPE.