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.