HTML <title>
Tag
The <title>
tag in HTML sets the title of a webpage, which appears in the browser tab and search engine results. It is placed inside the <head>
section of an HTML document.
1. Basic Syntax
✅ Displays "My Awesome Website" in the browser tab.
2. Where <title>
Appears
-
Browser Tab: The text inside
<title>
appears in the browser's title bar or tab. -
Search Engine Results: Search engines use the
<title>
as the clickable blue link in search results. -
Bookmarks & Social Media: When a page is bookmarked or shared, the
<title>
is shown.
3. Best Practices for <title>
✅ Keep it concise: 50-60 characters for better SEO.
✅ Make it relevant: Reflect the page’s content.
✅ Use keywords naturally: This helps with search ranking.
✅ Avoid duplicate titles: Each page should have a unique <title>
.
4. Example for SEO Optimization
✅ Optimized for search engines by including keywords like "Best Laptops" and "2025".
5. Dynamic Titles with JavaScript
You can change the <title>
dynamically using JavaScript:
✅ Updates the title without reloading the page.
6. Conclusion
-
The
<title>
tag defines the webpage title and appears in browser tabs & search results. -
It is important for SEO & user experience.
-
Use JavaScript to dynamically change the title.