Head

Now we know how to write some basic HTML its time we understood what goes into the head tag of a web page. The head tag is used for a number of things and we will be looking into it in detail in later sections.

<html>
<head>
<title>my web page </title>
</head>
<body>
hello world!
</body>
</html>

If we put this in the web browser the tab at the top of the browser instead of saying untitled document it will be "my web page".

The head tag is also used to link to external files such as javascript and CSS pages.

Doc Type

Now we move onto doctypes and these are declarations of the version of HTML you are using, this is so that web browsers render the web page without any problems. The doc type tells the browser what markup you are using.

There are different doctypes but for now just use this one and put it before the HTML tag, so its the first thing the web browsers sees when it reads your web page.

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">

Now you cant use HTML frame sets with this document type but they should never ever be used, I cant stress that enough its old, outdated and VERY unprofessional so stay away from it.

Now a few things don't work in internet explorer when not using a doctype in your web page such as auto margins which I will explain later in the CSS section.

The Meta Tag

The meta tag is used to store meta data such as the page description, the author and the date the page was last modified and other meta data. The meta tag goes inside the head tag of a web page and its written like this;

<meta name="description" content="Blue Web Tutorials" />

Now this will add a description to our web page saying "Blue Web Tutorials".

Another use for the meta tag is the ability to refresh the page every few seconds so to this type the following

<meta http-equiv="refresh" content="2;url=http://www.website.com" />

you can use this to refresh or direct to another web page.

                                                                                                                                                                            

This free website was made using Yola.

No HTML skills required. Build your website in minutes.

Go to www.yola.com and sign up today!

Make a free website with Yola