HTML <html> Tag
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 | |||||
12 | 1 | 1 | 12.1 | 1 |
Tablets / Mobile | |||||
18 | 4 | 12.1 | 1 | 1 | 4.4 |
Last updated by CSSPortal on: 30th March 2024