The HTML page title is the text displayed in the title bar or tab of a web browser. It is defined using the <title> tag within the <head> section of an HTML document. The title is important for several reasons, including usability, accessibility, and search engine optimization (SEO).
Basic Syntax
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>My Web Page</title>
</head>
<body>
<h1>Welcome to My Web Page</h1>
</body>
</html>
In this example, the content of the <title> tag is “My Web Page”. This text will appear in the browser tab and as the title of the page when bookmarked.
Importance of the HTML Page Title
1. Browser Tabs: The title helps users identify and switch between multiple open tabs.
2. Bookmarks/Favorites: When users bookmark a page, the title is used as the default name for the bookmark.
3. Search Engine Optimization (SEO): Search engines use the title to understand the content of the page. A well-crafted title can improve a page’s search ranking and click-through rate.
4. Accessibility: Screen readers announce the title of the page when it loads, helping users understand the page’s content.
HTML Page Title – Interview Questions
Q 1: Which tag defines the page title?
Q 2: Where is the tag placed?
Q 3: Is the page title visible on the webpage?
Q 4: Why is page title important?
Q 5: Can a page have multiple tags?
HTML Page Title – Objective Questions (MCQs)
Q1. Which tag is used to set the title of an HTML page?
Q2. Where should the tag be placed?
Q3. How does the title appear in a web browser?
Q4. Can you have multiple tags in one HTML document?
Q5. Which of the following is correct for setting a page title?