HTML relies on several elements to define the document as well as to provide information that is used by the browser or search engine.
Tip
Several common attributes used for structure, internationalization, and events are abbreviated as core, i18n, and events in the following quick reference sections. The description for each of these abbreviations can be found later in the "Common Attributes and Events" section.
<body>...</body>
Usage
Contains the document's content.
Attributes
core, i18n, events.
onload="..." Intrinsic event triggered when the document loads.
onunload="..." Intrinsic event triggered when the document unloads.
Notes
There can be only one <body>, and it must follow the <head>. The <body> element can be replaced by a <frameset> element.
<!DOCTYPE>
Usage
Version information appears on the first line of an HTML document and is an SGML declaration rather than an element.
Attributes
html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> Used for documents following the Strict XHTML requirements.
html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> Used for documents following the XHTML requirements, but also including some deprecated elements.
html PUBLIC "-//W3C//DTD XHTML 1.0 Frameset//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-frameset.dtd"> Used for framed documents.
<head>...</head>
Usage
This is the document header and contains other elements that provide information to users and search engines.
Attributes
i18n.
profile="..." URL specifying the location of meta data.
Notes
In general, there can be only one <head> per document. It must follow the opening <html> tag and precede the <body>. The <head> must include a <title>.
<html>...</html>
Usage
The html element contains the entire document.
Attributes
i18n.
<meta />
Usage
Provides information about the document.
Attributes
i18n.
http-equiv="..." HTTP response header name.
name="..." Name of the meta information.
content="..." Content of the meta information.
-scheme="..." Assigns a scheme to interpret the meta data.
<title>...</title>
Usage
This is the name you give your Web page. The <title> element is located in the <head> element and is displayed in the browser window title bar.