Only sixpence ha'penny. Bring back the half-crown.

grass

html tutorials

What makes a web page?

1st July 2008

What makes up the code that is behind a web page?

Well, the structure of a page is really quite straight forward and contains the following, in order:

  1. A document-type declaration that tells the browser that this is a web page
  2. The document header which contains information about the page
  3. The document body – the page itself, which is made up of the text and pictures and any other media that appear on the screen

Each is contained within the page structure as follows:

Structure of an HTML Page
Human Interpretation Computer Code
The Doctype declaration <!DOCTYPE ... standards declared>
html tag open <html + language declared>
head tag open <head>
head contents head contents ...
head tag closed </head>
body tag open <body>
body contents body contents ...
body tag closed </body>
html tag closed </html>

In summary, a page will look like this:

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" etc. >

<html xmlns="http://www.w3.org/1999/xhtml" etc.>

<head> ... </head>

<body> ... </body>

</html>

This shows that, after the document declaration, each tag opens and closes in the same manner. This pattern is repeated within the document contents, with some exceptions for elements that are "self-closing", and even then all of these follow the same pattern and rules of html.

Next up, we look at the document declaration.

« Back