<title> Tag in HTML | Document Title
The <title> tag in HTML is used to define the title of a webpage. The content within the <title>
tag is displayed on the browser tab, bookmarks, and search engine results, making it an essential tag for SEO and user experience.
Key Points on <title> Tag:
- Placement: The
<title>
tag is placed inside the<head>
section of the HTML document. - Uniqueness: Each HTML document should have a unique
<title>
to help users and search engines identify the content. - SEO Importance: Titles help with search engine optimization (SEO) as they describe the content of the page to search engines.
- Character Limit: Titles are best kept between 50-60 characters for optimal display in search engine results.
Syntax of <title> Tag:
Syntax Example
<!DOCTYPE html>
<html>
<head>
<title>Page Title Here</title>
</head>
<body>
<p>This is a sample webpage with a title.</p>
</body>
</html>
Output
The title "Page Title Here" will be displayed on the browser tab and as the title in search engine results.
Attributes of <title> Tag:
- No Attributes: The
<title>
tag does not support any attributes.
Best Practices for Using <title> Tag:
- Descriptive Titles: Create descriptive titles that summarize the page content accurately.
- Keywords: Use keywords naturally in the title to improve SEO but avoid keyword stuffing.
- Branding: Including a brand name at the end of the title can help with brand recognition (e.g., "Learn HTML - ExampleBrand").
- Relevance: Ensure each page on the website has a relevant, unique title.
The <title>
tag is crucial for webpage identification, providing users and search engines with an accurate representation of page content.