The HTML title tag serves the purpose of assigning a title to your webpage. This element is crucial for optimizing your website for search engines.
The HTML title element needs to be placed within the <head> tag.
The title of the webpage appears on the title bar of the browser window.
Let's see the example of HTML title tag.
<!DOCTYPE html>
<html>
<head>
<title>First web page.</title>
</head>
<body>
<p>Welcome to my first web page.</p>
</body>
</html>
Here we are utilizing two elements, namely the header tag and the title tag. The complete title element is enclosed within the header tag.
The head section, positioned before the body section, stores essential page details without showing them on the browser window. To showcase a specific title on the webpage, the title element is employed.
If you observe the example provided above, you will notice that the text "First web page" appears on the tab or title bar of the web browser. The content enclosed between <title> and </title> is what gets displayed on the title bar.
Supporting Browsers
| Element | Chrome | IE | Firefox | Opera | Safari |
|---|---|---|---|---|---|
<title> |
Yes | Yes | Yes | Yes | Yes |