The rules are summarized in the HTML specifications . Specifications for an HTML tag include the function of the tag, its attributes, what tags can appear within it and where the tag may be used. Now that HTML 4 has been tweaked to conform with XML, the end tags should always be used. Documents Are Structured HTML documents are heirarchically structured. Each type of element should occur only within certain other types of elements.
Pets are nice.
When you start using a new HTML command, take time to read the specification for the command carefully. If you are copying HTML from someone else's document, be aware that they may be using incorrect syntax. Even if you have a book that says you can leave off the end tags of some elements with end tags, always put in the end tags.