HTML Tags – HTML Tag


What is <html> tag ?

HTML <html> tag represents the root of an HTML document.

HTML <html> tag is a container tag that includes all other HTML elements.

HTML <html> tag have starting <html> and ending </html> tags.

Note: You should always include the lang attribute inside the <html> tag, to declare the language of the Web page.

How <html> tag works ?

HTML <html> tag provides the directions for the visual content that user sees on the Web.

HTML <html> tags plays an important role in the history of Web design.

HTML tags are still at the center for how Web pages are formatted visually.

Other languages like CSS and other client-side scripting languages are built around the backbone of HTML.

Why HTML <html> tags are used ?

HTML <html> tag is the root of an HTML document.


And <html> tag is the container for all other HTML elements (except for the <! DOCTYPE> tag).

HTML <html> tag displays the visual content of the web-page also we can modify the web-page by adding/removing the HTML elements.

HTML beginners tutorial !!!

Click to Learn More about – HTML Tutorial for beginners

Syntax :


<html>
<head></head>
<body></body>
</html>

Example :

<!DOCTYPE html>
<html>
<head>
  <title>HTML tag</title>
</head>
<body>
  <h1>Heading 1</h1>
  <h2>Heading 2</h2>
  <h3>Heading 3</h3>
  <p>Paragraph 1</p>
  <p>Paragraph 2</p>
  <p>Paragraph 3</p>
</body>
</html>

Output :

<html> Tag Attributes

HTML <html> tag support following specific attributes.

SnoAttributesValueDescription
1xmlnsnamespaceSpecify the XML Namespace of the document.
Default value is http://www.w3.org/1999/xhtml

Global Attributes

HTML <html> tag support following global attributes.

SnoAttributesValueDescription
1idunique_nameDeclared unique id for an element.
2classclass_nameDeclared one or more classnames for an element.
3stylestylesCSS inline styles specify an element.
4titletitleSpecify extra details of element contain, this will display as a “tooltip” for an elements.

Event Attributes

HTML <html> tag does not support any event attributes.

Browser Compatibility

SnoBrowserSupport
1ChromeYes
2FirefoxYes
3EdgeYes
4OperaYes
5SafariYes
6Internet ExplorerYes