Lesson 2:How to use title tag in HTML document

In lesson 1 we have seen that head and body portion contents are shown together on body part of the document. In this tutorials we will see how to use the title tag to show the head part separate from the body part.

Let me show you the document which were used in lesson 1 for reference.

<HTML>

<HEAD>

Here is the head part

</HEAD>

<BODY>

Here is the body part

</BODY>

</HTML>

There are some tags which can be used within head portion of html document, one of the basic and mandatory tag in head portion of html document is <title></title> provide the descriptive information about the document for display at the top of the screen not in the body of the document.

Let me show you how to use this tag to clear you understanding.

<HTML>

<HEAD>

<TITLE>

Here is the head part

</TITLE>

</HEAD>

<BODY>

Here is the body part

</BODY>

</HTML>

There are some changes in our last document (filename.htm) you can use the same code and save the document. Addition of title tag display the contents on the title bar of the browser rather then body part as shown in the figure.

image

I hope now you can understand the purpose of using <title></title> tags in the head portion of the html document.

Be Sociable, Share!

Leave a Reply