Basic structure of an HTML document
builtby3
 Home
 RAW Code
 HTML structure
 Adding text
 Adding graphics
 Graphics 2
 Linking pages
 Creating lists
 Other stuff
 Assignment
 Test
 About

A simple, but fully functioning web page might look something like this...

html code2 

Notice three things:

  1. Every HTML document MUST start with the tag <HTML>
    • This is to tell your browser that this is, in fact, an HTML document, and not simply an ordinary text file.
  2. Every tag MUST be closed with its mirror-image tag (e.g.: </HTML>
    • This is vitally important.  If you open a tag, close it.
    • Every tag forms a PAIR - an open and a close `half´
    • Closing a tag lets your browser know what is going on - where to stop making text bold, where to end the underlining and so on
    • To close a tag, simply write it again, but place a slash in front of it, as the example above clearly illustrates.
  3. There are distinct sections to an HTML document
    • The opening and closing HTML tags are mandatory
    • The <HEAD> and </HEAD> tags (and everything between them) are customary, but not mandatory
    • The <BODY> and </BODY> tags are also mandatory - since this is the bit that is displayed on your screen.  Without a BODY, there is nothing to display.