HTML <html> Tag

If this site has been useful, we’d love your support! Running this site takes time and resources, and every small contribution helps us keep creating valuable content. Consider buying us a coffee to keep things going strong!

Description

The <html> HTML element is a container that encloses the entire contents of a web page, including the <head> and <body> elements. The opening and closing <html> tags in the document are optional, but a good style dictates their indispensable use. As a rule, <html> comes second in the document, after determining the type of document (Document Type Definition, DTD) set via <!DOCTYPE> . The closing <html> tag is always the last in the document.

Properties

Permitted Parents
None. This is the root element of a document.
Content
<head> and <body>
Start/End Tags
Start tag: optional, End tag: optional

Example

<html>
<head>
<title>Title of the document</title>
</head>
<body>
The content of the document......
</body>
</html>

Attributes

Attribute Definition
version Specifies the HTML DTD version of the document. The version attribute is deprecated - use the <!DOCTYPE> tag instead.

Global Attributes

The <html> tag also supports the Global Attributes in HTML5

Event Attributes

The <html> tag also supports the Event Attributes in HTML5

Browser Support

The following table will show you the current browser support for the HTML <html> tag.

Desktop
Edge Chrome Firefox Opera Safari
121112.11
Tablets / Mobile
Chrome Firefox Opera Safari Samsung Webview
18412.1114.4

Last updated by CSSPortal on: 30th March 2024