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. |
content | Specifies the property's value. |
scheme | Specifies a scheme to use to interpret the property's value (as declared in the content attribute). |
http-equiv | Used for http response message headers. For example http-equiv can be used to refresh the page or to set a cookie. Values include content-type, expires, refresh and set-cookie. |
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
Desktop | |||||
Yes | Yes | Yes | Yes | Yes | Yes |
Tablets / Mobile | |||||
![]() |
|||||
Yes | Yes | Yes | Yes | Yes | Yes |
Last updated by CSSPortal on: 6th December 2019
HTML Tags
- a
- abbr
- address
- area
- article
- aside
- audio
- b
- base
- bdi
- bdo
- blockquote
- body
- br
- button
- canvas
- caption
- cite
- code
- col
- colgroup
- comment
- datalist
- dd
- del
- details
- dfn
- dialog
- div
- dl
- doctype
- dt
- em
- embed
- fieldset
- figcaption
- figure
- footer
- form
- h1
- h2
- h3
- h4
- h5
- h6
- head
- header
- hr
- html
- i
- iframe
- img
- input
- ins
- kbd
- keygen
- label
- legend
- li
- link
- map
- mark
- menu
- meta
- meter
- nav
- noscript
- object
- ol
- optgroup
- option
- output
- p
- param
- picture
- pre
- progress
- q
- rp
- rt
- ruby
- s
- samp
- script
- section
- select
- small
- source
- span
- strong
- style
- sub
- summary
- sup
- table
- tbody
- td
- textarea
- tfoot
- th
- thead
- time
- title
- tr
- track
- u
- ul
- var
- video
- wbr