HTML-Lesson 4

Templates 3

Now

With your template in your text editor, think up a file name and 'save as' that name. Do this before you add any content and you won't have to retype your template at some future date.

Note

Your 'main' (or 'home' page) usually has to be named 'index.htm'. The reason being that when you type a 'url' (web page address) into the address bar of your browser it looks for a file named 'index' so that you do not have to type in a file name as well as the url!

Now add the text of your own heading and one of more paragraphs.

Open your web page in a Browser. Now go back to your text editor and make corrections and additions to your page. Click on 'save in the editor and click on 'reload' in the Browser. Repeat this process until you are satisfied.

File names

Warning

It is a very good practice to keep all file names in lower case (including the file extensions). Also, do not use spaces in file names. If you think that a space or something like it is essential, use the underscore character. Finally keep file names relevant, but short.

Expand your Template
In this tutorial, I propose to teach the most up-to-date material. This means that there will be some details to add to your template before you learn about them. I do provide references forward for these details.

Expand your templates as follows:
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<title>
Title</title>
</head>
<body>
<h1>
A large heading</h1>
<p>
A paragraph of content
</p>
</body>
</html>

The 'Doctype' and the attribute for the 'html' tag are discussed in HTML Lesson 16. Examine your web page in your browser. You should see no change.

Previous Lesson previous lesson next lesson Next Lesson