HTML Tutorial

HTML Tag: <title>

Usage of <title>

The <title> tag defines the title of a webpage, which appears in the browser tab, search results, and other places. It is essential for providing context and identifying the page's purpose.

Attributes of <title>

The <title> tag has one optional attribute:

  • lang: Specifies the language of the title.

Examples with <title>

  • Basic usage: <title>Web Page Title</title>
  • With language attribute: <title lang="en">English Web Page Title</title>

Exploring the <title> Tag: A Simple HTML Example

<!DOCTYPE html>
<html>
<head>
  <title>My Web Page Title</title>
</head>
<body>
  <h1>Welcome to My Web Page</h1>
  <p>This is a simple HTML page.</p>
</body>
</html>

When this code runs in a browser, the title "My Web Page Title" will appear in the browser tab and search results.