Courses
Courses for Kids
Free study material
Offline Centres
More
Store Icon
Store

Adding Title to a Web Page

Reviewed by:
ffImage
hightlight icon
highlight icon
highlight icon
share icon
copy icon
SearchIcon

An Introduction to the Title of a Web Page

The title of a web page is a short description of the contents of the web page. It appears at the top of a browser window and search engine result pages (SERP). It is the hyperlink that users click on. The title of the web page is the default title used when someone bookmarks the page. It does not appear in the body of a web page.


How to Add a Title to a Web Page?

To add a title to a web page, we use the <title> and </title> tags of the HTML header. It is placed between <head> and </head> tags.


Syntax to Add a Title to a Web Page


Example of adding a Title to a Web Page


Example of Adding a Title to a Web Page


Code snippet showing how to add title to a web page

Code Snippet Showing How to Add Title to a Web Page


In the above example, we see "Hello World" written between <title> and </title> tags. The title element will accept the value between its opening and closing tags and this value will label the page from here on. 


This means "Hello World" is the title of the page and will be shown on the search engine result page (SERP) for a related search query. It will be the default title when a user bookmarks the page.


Importance of the Title of a Web Page

Adding a title to the web page allows search engines to determine its relevance regarding a specific search query and gives the users an idea of what information it contains. The title tag has an impact on several functions of web pages like:

  • Default bookmark titles 

  • Flashing words pulling your attention back to the page, even when in a different tab.


Points to Remember

  • The <title> tag should be defined in the <head> tag.

  • The <title> tag can only be used once on a web page.

  • There can be only one title per web page.


Learning by Doing

Choose The Correct Answer

1. The title of the web page appears in the body of the page.

  1. True

  2. False


2. The <title> tags are placed

  1. Before the <head> tags

  2. Before the <h1> tags

  3. Between the <head> tags

  4. Before the <body> tags


3. The title of a web page is the default title used when someone bookmarks the page.

  1. True

  2. False


Solved Questions

1. What is wrong with the code given below?

<html>

<title>Good morning

</head>

</html>

Ans: The opening <head> tag and the closing </title> tag are missing.


2. What is the syntax to define a title?

Ans: <title>Title name</title>


3. Why does a web page need a title?

Ans: The title of a web page allows search engines to determine its relevance regarding a specific search query and provides the users with an idea of what information it contains.


Summary

The title of a web page is the name that appears on SERP. It is added using the <title> tag. The title of the web page gives the users an idea about its contents. We hope you learnt something new about adding a title to a web page. Try to practise the questions shared below to assess your knowledge and understanding of the topic. Also, visit our website to read more of such articles about computers.

FAQs on Adding Title to a Web Page

1. What is the difference between the title of a webpage and the title of a website?

The title of a website is the name of the website also known as the URL. However,  the title of a web page is the name of that single page of a website.

2. How long should the title of a web page be?

It is recommended that the title of a web page be about fifty to seventy characters long. This will prevent the majority of the title from being cut off from being displayed as the character's limits are based on how it is displayed on desktop and mobile devices.

3. What is the difference between the <title> tag and <h1> tag?

<title> tags are shown in search engines and the title bar at the top of the web browsers.


<h1> tag appears within the body of the web page. This does not appear in search engines.