HTML <html> Tag
Our topic in this post is Tag HTML examples. In hopes that it would provide learners with what they need to learn.
The HTML <html> tag is used to define the root element of an HTML document. It is the first tag in an HTML document and contains all the other HTML elements on the page.
Here is a basic HTML document:
Example
Here is complete example of the <html> tag:
Example: 
HTML <html> Tag Importance
The <html> tag is of utmost importance in HTML because it is the root element of an HTML document and is used to define the basic structure of the document. Here are some reasons why the <html> tag is important:
- The <html> tag is used to define the document type and version using a document type declaration (DTD). This tells web browsers and other software how to interpret the content of the document.
- The <html> tag provides the structure for the entire document and contains all the other HTML elements on the page. The <html> tag is always the first tag in an HTML document and serves as the root element for the document.
- The <html> tag can include the lang attribute, which specifies the language of the document. This is important for accessibility, as it helps screen readers and other assistive technologies to correctly pronounce and interpret the text on the page.
- The <html> tag can include other attributes such as the title and meta tags that are important for search engine optimization. The title tag is used to define the title of the document, while the meta tag provides information about the document such as keywords, descriptions, and author information.
- The <html> tag can include the lang attribute, which supports internationalization by allowing web developers to specify the language of the document. This is important for making sure that the content on the page is properly translated and localized for different audiences.
Tag HTML Usage
The Tag HTML <html> identifies the starting point of an HTML document.
The <html> tag is the umbrella tag that covers all HTML elements (except for the <!DOCTYPE> tag).
Attributes
Attribute | Value | Overview |
---|---|---|
xmlns | Indicate the XML namespace attribute(if you want to conform your content to XHTML) |
Browser Compatibility
Element | |||||
---|---|---|---|---|---|
<html> | Yes | Yes | Yes | Yes | Yes |
Attributes
Global
The <html> tag is also compatible with Global Attributes in HTML.
Predefined CSS
Generally, many browsers present the <html> element with these default values:
html { display: block; } html:focus { outline: none; }