Writing a structured document does not mean that you are writing in a straitjacket. It only means you have to lay out the document in advance. It also means the document becomes easier to read, maintain and extend. While this may not seem too important if you just want a homepage, when you have a whole site to maintain, well-structured documents make life a lot easier!
It is also important to note that HTML uses the ISO-8859-1 character set. Apart from the entities defined in the Wilbur draft, the characters from this list are the only ones you should use. Other characters are not guaranteed to show up at all in a browser, let alone show up as the character you're hoping for.
Every HTML 3.2 compliant document should look basically as follows:
(Note: the line numbers are only here for the explanation below)
1. <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2//EN"> 2. <HTML> 3. <HEAD> 4. <TITLE>The title of the documents</TITLE> 5. <META NAME="description" CONTENT="This is a document"> 6. <LINK REV="made" HREF="mailto:galactus@htmlhelp.com"> 7. </HEAD> 8. <BODY> 9. ... document body 10. </BODY> 11. </HTML>
If your document is HTML 2.0 compliant, the DOCTYPE of it is
<!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML 2.0//EN">
Some HTML editors like to include an arbitrary DOCTYPE declaration in your documents, even when it is not correct. Note that in particular, any doctype for HTML 3.0 is not an "official" declaration, since that proposal has been expired for a long time now.
The HEAD tag is optional. If you arrange all the information about the document at the top of the document, and all body tags below, it is obvious for a parser where the header ends and where the body begins.
This particular META tag provides a description of the document, which is used by search engines such as Alta Vista and Infoseek.
This particular LINK tag gives the address of the document's author. Some browsers (most notably Lynx) allow you to send a comment to this person with one keystroke if this tag is defined.
Designing a structured contents for your HTML document is an art in itself. I won't go into it too deeply here. Initially, use only the six headers to set up the structure of the document, adding lists, tables and other block elements until the general layout of the document is finished. Then begin filling in the blocks, marking up the text with the appropriate text-level elements. Images are very important, but as the IMG tag is a text-level tag, it must be contained in a block-level tag.
Often a document will be part of a set, so it will use a common style. This style should specify a standard structure for documents, including navigation aids and standard images. Writing a template is then a very handy thing. The WDG's Style guide for online hypertext discusses this in more detail.
HTML 3.2 Reference ~ Elements by Function ~ Elements Alphabetically
Home, Forums, Reference, Tools, FAQs, Articles, Design, Links
Copyright © 1996 - 2006 Arnoud Engelfriet - All rights reserved.