title
The HTML <title> element names a document. Its text appears in browser tabs, bookmarks, history, and often search-result titles.
What you will learn
- Where
titlecommunicates a page’s name - How browsers, history, and search engines use it
- How to write a short title that matches the content
Basic syntax
<head>
<title>Learn HTML forms - Yugien</title>
</head>
Place one title element inside head. The text should identify the specific page, not merely repeat the site name.
Write a useful page title
A good title is concise, specific, and consistent with the page’s main content. Put the most useful topic near the beginning and add the site name when it helps distinguish the page.
- Weak
HomeorPage 1gives little context.- Clear
HTML button element: choose the right type - Yugienidentifies the topic and site.
title is not the visible h1
title is metadata in head; h1 is the main visible heading in the page content. They can share the same topic, but they serve different locations and tasks. Keep both accurate.
Search and accessibility notes
Browsers and search engines may shorten or rewrite displayed titles, but a precise source title is still important. Clear titles help people distinguish tabs and history entries, including people using screen readers or many open tabs.
Common mistakes
- Omitting
titleor leaving it empty. - Using the same generic title on every page.
- Stuffing keywords into a title that no longer describes the page naturally.
- Putting visible explanatory text in
titleinstead of the page content.