Producing web pages
HTML CSS DHTML XHTML A to Z of tags        Design    Internet

How do I create an HTML page?

You can create an HTML file with any text editor, word processor or with a variety of tools such as Allaire's HomeSite© or Microsoft® Front Page. The pages themselves are plain text files (ASCII) with special tags or codes that a web browser knows how to interpret and display on your screen.

Before you start, you should know a few basic things about tags:

  • You put all HTML tags within < > brackets and tags are not case sensitive. So <BODY> is the same as <body>. I would use lowercase tags because XHTML (the next generation HTML) insists on them
  • Most tags have a start and an end tag. For example, the start tag <b> makes all the text that come after it bold until the browser sees the end </b> tag. There are a few tags known as empty tags that don’t have an end tag. Examples are <br>, <hr>, and <img>
  • Not all browsers support all the tags. If the browser doesn't recognise a tag, it just ignores it

You type in the page and then save it with a .html or a .htm extension to the file (for example mypage.html). If you use a word processor, remember to save the file as "text only with line breaks".

So, here is a very basic HTML document:

<!doctype html public "-//W3C//DTD HTML 4.0//EN">
<html>
<head>
<title>Ann’s HTML document</title>
</head>
<body>A very simple HTML document.</body>
</html>

The first line contains the HTML version number and document type definition. You don’t really need to know much about this line but there is a description in the A to Z of tags.

The rest of the HTML document starts with the <html> tag that tells your browser that this is the start of an HTML document. The last tag in your document is a corresponding </html> tag. You must have this closing tag.

Within your <html> and </html> tags, you need to put the two main sections of an HTML document: the header and the body.

  • The <head> and </head> tags mark the beginning and the end of the header information that applies to the whole page. Typically, the <title> tag appears in the header
  • The <body> tag appears after the closing </head> tag. You should put the corresponding </body> tag just above the closing </html> tag. The <body> tag identifies the main part of your document. You include all your text, pictures, sound, forms to fill in, links to other pages and so on in the body section

You can now move on and add the HTML header and body.