The HTML HEAD element

So far we have left the HEAD section of the Web page empty but our pages still work. There are some important things to put in the HEAD element though (and before it). You do not need to understand these at this stage. You will learn about what the elements in the HEAD mean in the intermediate HTML tutorial. For now just start every Web page you create for this site with this:

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">        

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

<head>

<meta http-equiv="content-type" content="text/html;charset=utf-8" />

<title>An awesome page</title>

</head>
        

Open page2.html in your editor. Delete the existing HEAD tags and paste the above in their place.

Title

The only element you need to change for different pages is the TITLE element

Almost all Web pages have a title. It appears in the top of the browser program window (the title bar!). At the top of your browser now should be the name of your browser and the text "The HTML HEAD element". To add a suitable title to your page2.html insert the text between the TITLE tags above:

<title>My page title</title>
        

Save the page and view it in a browser.

You will learn about what the HEAD elements all mean in the Intermediate HTML tutorial. For now just accept that it all needs to be there for your pages to work properly.

A template to save time

You could create a new document (maybe called template.html) which includes this code plus the BODY and closing HTML tags. Then you could use it every time you need a new, blank page which is ready to use.

submit to reddit Delicious Tweet