Tuesday, September 14, 2010

Closing your document

Back at the start of this chapter, we examined basic HTML and XHTML documents.
Regardless of the technology used, the end of the document should look like this:
</body>
</html>
There are no variations or alternatives. A body end tag terminates the document’s content,
and an html end tag terminates the document itself. No web page content should come
after the body end tag, and no HTML content should come after the html end tag (whitespace
is fine, and it’s common practice with server-side technologies to put functions after
the html end tag—just don’t put any HTML there).
Also, you must only ever have one body and one head in an HTML document, as well as a
single html start tag and a single html end tag.
This is important stuff to bear in mind, and even if you think it’s obvious, there are millions
of pages out there—particularly those that utilize server-side includes and server-side
languages—that include multiple body tags and head tags, have content outside the body
tag, and have HTML outside the html tag.
Don’t do this in your own work.

No comments:

Post a Comment