HTML Tutorial

HTML Tag: <html>

Usage:

The <html> tag is the root element of an HTML document and encompasses all other HTML elements. It serves as the container for the entire HTML structure.

Attributes:

  • lang: Specifies the language of the document's content.

Examples:

<html>
...
</html>
<html lang="en">
...
</html>

Exploring the <html> Tag:

<!DOCTYPE html>
<html>
<head>
  <title>My Website</title>
</head>
<body>
  <h1>Welcome to my website!</h1>
</body>
</html>

In this example:

  1. The <html> tag is the root element.
  2. The <head> element contains information about the document, such as the title.
  3. The <body> element contains the main content of the document.
  4. The <title> element specifies the title of the web page.
  5. The <h1> element creates a heading with the text "Welcome to my website!".

Additional Tips:

  • The <html> tag must be the first and last element in an HTML document.
  • It is recommended to include the lang attribute to specify the language of the document's content.
  • The <html> tag can be used to group elements into different languages or sections.