<title> tag is used to specify the page title. Page titles are not so important for users, but they are very important for SEO (Search Engine Optimization). This tag is placed in the <head> section of the page.
<title> element in a <head> section.
<html> <head> <title>Introduction to Programming</a> </head> <body> <!-- content here --> </body> </html>
<title> tag defines the page title. A page can only have a single
Text inside the
<title> element will be shown on the browser tab.
<title> text will also be used when the page is added as a favorite.
Search engines use the
<title> as the title of search results.
To the average user the page title is not important. Its value displays in the browser tab which often is too small to show the full title. Only when hovering over the tab is the text visible in a tooltip. In general, H1 tags are far more relevant to the user.
In contrast, the title tag is extremely important for SEO (Search Engine Optimization) purposes. Google's search result displays the page title prominently as a link to your site. The page title is also used for indexing. Therefore, with a public facing site, pay great attention to the page title and ensure it represents the page content well.
Below are Google's search results for 'history of C#'. As you can see, the title is used as a direct link to the page. Google also uses the title as part of their algorithm to find a match with the search string that was entered.
<title> element itself has no attributes, but it does accept global attributes.
They are rarely, if ever, used.
document.title = 'New page title';
<title> tag is part of a group of tags that
define the structure of a web page.
This group is referred to as the Page tag group.
Together, these tags allow you to create solid, well-structured web pages.
Here is the complete list.
|<!DOCTYPE>||Must appear on the first line of a page. Specifies the HTML version|
|<html>||Defines the root container for an HTML document|
|<head>||Creates a head container that holds page-level metadata elements|
|<meta>||Provides metadata about a web page|
|<link>||Defines a link to an external source, such as a style sheet|
|<base>||Sets the base URL for all relative URLs on a page|
|<style>||Adds CSS style elements to a page|
|<title>||Specifies the page title that displays in the browser's tab|
|<body>||Specifies a container for the content of the page, with text, links, images, etc.|
Here is when
<title> support started for each browser: