Basic Structure
HTML <html> Tag
The <html> tag represents the root of an HTML document.
Definition and Usage
The <html> tag represents the root of an HTML document.
Standard Syntax:
<html>...</html>Interactive ExampleRunnable
HTML <html> Example
htmlLive code demonstration for the <html> tag. Click "Try it Yourself" to edit and experiment in real time.
<!DOCTYPE html>
<html lang="en">
<head>
<title>Title of the document</title>
</head>
<body>
<h1>This is a heading</h1>
<p>This is a paragraph.</p>
</body>
</html>Attributes for <html>
1 Supported Attributes| Attribute | Values | Default | Description |
|---|---|---|---|
| xmlns | http://www.w3.org/1999/xhtml | none | Specifies the XML namespace attribute (If you need your content to conform to XHTML) |
Global Attributes
The <html> tag also supports the standard global attributes in HTML, including class, id, style, title, hidden, and data-*.
Event Attributes
The <html> tag supports event attributes in HTML, such as onclick, onmouseover, onfocus, and more.
Browser Compatibility
ChromeEdgeFirefoxSafariOpera
More Tags in Basic Structure
View All 123Tags →<base>The <base> tag specifies the base URL and/or target for all relative URLs in a document.<body>The <body> tag defines the document's body.<!--...-->The comment tag is used to insert comments in the source code. Comments are not displayed in the browsers.<!DOCTYPE>All HTML documents must start with a <!DOCTYPE> declaration.<head>The <head> element is a container for metadata (data about data) and is placed between the <html> tag and the <body> tag.<meta>The <meta> tag defines metadata about an HTML document. Metadata is data (information) about data.