Creating an HTML document

Before you start writing code to write a web page, it is a good practice to plan ahead the appearance of the web page. An HTML document has two elements:

  1. Document Content
  2. Tags

Document content is the information on a web page that the user will see. That information could be text or graphics, for example. As you start creating your own web pages, try finding out first what information you want to display and how you want to present it.

Tags are the HTML codes that control how the document content will appear. The tags, in other words, will determine whether the text will be bold, black or blue, or of font type Time New Roman or Airal.

Naming conventions

HTML files names are very important as they are used to locate or open the files. Remember these points when naming HTML files:

  1. Save your web page files with the .htm or .html file extension. (Both of these files represent HTML files, older systems such Windows 3.1 and DOS cannot recognize four-letter file extensions. Because the first three letters of .html and .htm are the same, those systems ignore the "l" and just recognize ".htm".)
  2. Some web servers are case-sensitive. That means those web servers would consider page1.htm and Page1.htm as two different files. To avoid case sensitivity problems, use only lowercase or uppercase letters to name your files.
  3. Filenames should consists only of letters and numbers. Avoid using spaces, punctuation, or special characters. If you need to separate words, use hyphen (-) and underscores (_), for example, creating-an-HTML-document.htm or creating_an_HTML_document.htm.

These same recommendations should also be applied to naming folders of your web site. See the example below:

HTML File naming conventions

The image shows folder names follow the same naming conventions as the file names; for instance, folder names and file names are separated by a hyphen if the name consists of more than one word.