Learn HTML – Part 1 – html Tag

Description

The <html> tag is the root of any HTML document. It wraps all the content on the entire page, including the <head> and <body> tags. Everything you write for a webpage goes inside the <html> element.

Syntax:

<html>
<!-- head and body go here -->
</html>

Attributes:

AttributeDescription
langSpecifies the language of the document (e.g., en, fr, es)

Example:

<html lang="en">
<head>
<title>My First Webpage</title>
</head>
<body>
<h1>Hello World!</h1>
</body>
</html>

Try It Yourself

Notes:

  • The <html> tag must be the top-most element.
  • Always include the lang attribute to help screen readers and SEO tools.
  • It is best practice to follow the proper HTML document structure:
<!DOCTYPE html>
<html>
<head>...</head>
<body>...</body>
</html>
Facebook
WhatsApp
Twitter
LinkedIn
Pinterest

Leave a Comment

Your email address will not be published. Required fields are marked *

Scroll to Top