HTML Page Title

The title of an HTML page is defined using the <title> tag. This title appears in the browser tab and is used by search engines and bookmarking tools.

Syntax

<!DOCTYPE html>
<html>
  <head>
    <title>My Website Title</title>
  </head>
  <body>
    <h1>Welcome to My Website</h1>
    <p>This is a sample page.</p>
  </body>
</html>

Key Points

  • The <title> tag must be placed inside the <head> section.
  • It should be short, descriptive, and unique for every page.
  • Search engines display this title as the main link in search results.

Example (Browser Tab)

If your title is: <title>About Us - AIT Academy</title>

The browser tab will show: About Us - AIT Academy

Best Practices

  • Keep the title under 60 characters.
  • Include relevant keywords for better SEO.
  • Make sure each page has a unique title tag.

Example

Output :

Practice Exercises

Task 1: How to set page title in HTML?

Goal: Learn how to define a descriptive document title using the <title> tag inside the <head> section.
💡 Hint: Place <title>...</title> inside the <head> tag.
💡 Show Solution
<!DOCTYPE html>
<html>
  <head>
    <title>AIT - Academy of Information Technology</title>
  </head>
  <body>
    <p>Welcome to the Academy of Information Technology. Learn HTML, CSS, JavaScript and start your journey in web development today!</p>
  </body>
</html>
Output :
🌐 AIT - Academy of Information Technology

Welcome to the Academy of Information Technology. Learn HTML, CSS, JavaScript and start your journey in web development today!

Explanation: The <title> element is required in HTML documents and sets the text displayed on browser tabs, search engine results, and bookmarks.