Document elements
Root elements provide the containers enclosing all other HTML elements. Every HTML page has these elements. The surrounding tags may be omitted. However, some utilities may not recognize or correctly handle the document if this is done.
<html>
…</html>
Delimit an HTML document (i.e. instead of an XML or another class document). The HTML element takes the attributes lang for the primary language for the document (such as en
for English) and a profile for a URI specifying metadata for the document (rarely used). The only contents allowed in an HTML element is one head
element and one body
element. (See Frames, below, for an exception where body
is not used.)
<head>
…</head>
Delimit the header section of the document, which contains information about the page. The head
element basically contains the metadata for the document. There are seven possible head elements including a meta
element for extensible specification of metadata.
<body>
…</body>
Delimit the body section of the document, which contains the displayed content of the page.
These root elements are arranged as follows:
<html>
<head>
Any of the various head related elements arranged in any order and occurring any number of times except base
and title
which can only occur once each. Title is the only required head
element.
</head>
<body>
At least one of either a block element or a script
element must occur,(though any number may occur), arranged in any order to suit the meaning and also typically the presentation of the document. The INS
and Del
body
element when used as block level elements. The other block elements are: paragraph (p
), heading (h1
...h6
), block quotation (blockquote
), ordered list (ol
), unordered list (ul
), definition list (dl
), division (div
), no script support (noscript
), form (form
), table (table
), fieldset (fieldset
), and address (address
). No other HTML elements are valid within the body
element.
</body>
</html>