- HTML Tutorial
- HTML Introduction
- HTML Editors
- HTML Basic
- HTML Comments
- HTML Elements
- HTML Attributes
- HTML Id & Classes
- HTML Skeletal Tags
- HTML Heading Tags
- HTML Paragraph Tag
- HTML Line Break Tag
- HTML Pre Tag
- HTML Anchor Tag
- HTML Image Tag
- HTML Horizontal Line Tag
- HTML Inline & Block
- HTML Inline
- HTML Block
- HTML LInks
- HTML Images
- HTML Formatting
- HTML Head
- HTML Head
- HTML Title
- HTML Meta Elements
- HTML Favicon
- HTML Style
- HTML List
- HTML Lists
- HTML Unordered List
- HTML Ordered List
- HTML Description List
- HTML Table
- HTML Tables
- HTML Table Headers
- HTML Table Styling
- HTML Table Colgroup
- HTML Form
- HTML Forms
- HTML Form Elements
- HTML Form Attributes
- HTML Input Types
- HTML Input Attributes
- HTML Form Actions
- HTML Semantic
- HTML Semantics
- HTML Graphics & Media
- HTML Canvas
- HTML SVG
- HTML Video & Audio
- HTML Plug-ins
- iFrames in HTML
- HTML Miscellaneous Tags
- HTML Code Tag
- HTML Entities
- HTML Quotation
- HTML Global Attributes
- HTML Obsolete Tags
- HTML Emojis
- HTML Symbols
- HTML Events
- HTML Colors
HTML Title
In HTML, the <title> element is a mandatory part of every document. It defines the text that appears in the browser's title bar or the page's tab. While it might seem like a small detail, it is one of the most critical elements for both User Experience (UX) and Search Engine Optimization (SEO).
The title serves three primary purposes:
- Browser Tabs: It helps users identify your page when they have multiple tabs open.
- Search Results: Search engines like Google use the title as the clickable headline in search results.
- Bookmarks: When a user saves your page to their favorites, the title is the default name used for the bookmark.
Here is how you implement the <title> element within the structure of a standard HTML document:
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<meta name="description" content="A brief description of the page content for search engines.">
<meta name="author" content="Your Name">
<!-- This is the title element -->
<title>Contact Us | Awesome Web Services</title>
</head>
<body>
<h1>Get in Touch</h1>
<p>Welcome to our contact page.</p>
</body>
</html>
document.title = "New Title" to reflect the user's current view.
Breaking Down the Example
In the code snippet above, we see several important tags within the <head> section:
- <title>: This sets the text "Contact Us | Awesome Web Services" as the page identity. This should be unique for every page on your website.
- <meta charset="UTF-8">: This ensures that your page displays text characters correctly, including emojis or special symbols.
- <meta name="description">: While the title is the headline in search results, the description is the short summary (snippet) that appears below it.
Real-World Title Examples
Choosing a generic title like "Home" or "Index" is a missed opportunity. Instead, follow these professional patterns:
- E-commerce Product:
<title>Blue Suede Shoes - Men's Footwear | ShoeStore</title> - Blog Post:
<title>10 Tips for Better CSS Layouts - WebDev Blog</title> - Service Page:
<title>Affordable Web Design Services in New York</title>
<strong> or <img>) inside a title. If you do, the browser will render them as literal text strings.
You can replace "My Simple HTML Form" with any title that accurately represents your page. Remember that clarity is key; a user should know exactly what is on the page just by reading the tab title.