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

html
Try it Yourself
Live 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
AttributeValuesDefaultDescription
xmlnshttp://www.w3.org/1999/xhtmlnoneSpecifies 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-*.

HTML Global Attributes Reference →
Event Attributes

The <html> tag supports event attributes in HTML, such as onclick, onmouseover, onfocus, and more.

HTML Event Attributes Reference →

Browser Compatibility

ChromeEdgeFirefoxSafariOpera

More Tags in Basic Structure

View All 123Tags →