The HTML <title> tag
The HTML <title> element sets the document's title — shown in the browser tab, bookmarks, and as the clickable headline in search results. It lives in the <head>, there is one per page, and it is one of the most important on-page SEO elements.
Overview
The <title> element defines the page's title. Browsers show it in the tab and use it for bookmarks and history, and — most importantly for visibility — search engines display it as the clickable headline of your result in the listings.
It must be plain text, it sits inside the <head>, and there must be exactly one per document. Because it does so much SEO work, it is worth writing deliberately: give every page a unique, descriptive title, front-load the important words, keep it to roughly 60 characters so it is not truncated in results, and make sure it reflects the page's actual content.
Do not confuse it with the title attribute, which provides tooltip text on any element — they share a name but are completely different things.
Syntax
<head>
<title>Contact Us — CodeShack</title>
</head>
Example
<title>HTML Reference: Tags, Attributes & Examples — CodeShack</title>
Best practices
- Write a unique, descriptive
<title>for every page. - Front-load the important keywords and keep it to roughly 60 characters.
- Make it reflect the page's actual content so it is useful in search results.
- Do not confuse it with the title attribute, which is for tooltips.
Frequently asked questions
What is the title element?
How long should an HTML title be?
What is the difference between the title element and the title attribute?
<title> element sets the page title in the head; the title attribute adds tooltip text to any element.