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.
Sno | Attributes | Value | Description |
---|---|---|---|
1 | xmlns | namespace | Specify the XML Namespace of the document. Default value is http://www.w3.org/1999/xhtml |
Global Attributes
HTML <html> tag support following global attributes.
Sno | Attributes | Value | Description |
---|---|---|---|
1 | id | unique_name | Declared unique id for an element. |
2 | class | class_name | Declared one or more classnames for an element. |
3 | style | styles | CSS inline styles specify an element. |
4 | title | title | Specify 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
Sno | Browser | Support |
1 | Chrome | Yes |
2 | Firefox | Yes |
3 | Edge | Yes |
4 | Opera | Yes |
5 | Safari | Yes |
6 | Internet Explorer | Yes |