XHTML Structure
XHTML relies on several elements to provide structure to a document (as opposed to structuring the text within) as well as to provide information that is used by the browser or search engines.
<bdo>…</bdo>
Usage | The bidirectional algorithm element used to selectively turn off the default text direction. | Start/End Tag | Required/Required. | Attributes | core.
lang="language"
The language of the document.
dir="direction"
The text direction (ltr, rtl). Mandatory attribute. | Empty | No. |
<body>…</body>
Usage | Contains the document's content. | Start/End Tag | Optional/Optional. | Attributes | core, i18n, events.
onload="eventcode"
Intrinsic event triggered when the document loads.
onunload="eventcode"
Intrinsic event triggered when document unloads. | Empty | No. | Notes | There can be only one <body>, and it must follow the <head>. The <body> element can be replaced by a <frameset> element. |
Comments <!-- … -->
Usage | Used to insert notes or scripts that are not displayed by the browser. | Start/End Tag | Required/Required. | Attributes | None. | Empty | Yes. | Notes | Comments are not restricted to one line and can be any length. The end tag is not required to be on the same line as the start tag. |
<div>…</div>
| Usage | The division element is used to add structure to a block of text. | | Start/End Tag | Required/Required. | | Attributes | core, i18n, events. |
You may run across HTML web pages that use the <div> element with an attribute named align. This attribute was removed in XHTML, with the new approach to alignment involving the text-align CSS style property. This style property is covered later in this appendix. |
| | Empty | No. | | Notes | Cannot be used within a p element. |
<!doctype...>
Usage | Version information appears on the first line of an HTML document and is an SGML declaration rather than an element. |
<h1>…</h1> Through <h6>…</h6>
Usage | The six headings (h1 is uppermost, or most important) are used in the body to structure information in a hierarchical fashion. | Start/End Tag | Required/Required. | Attributes | core, i18n, events. | Empty | No. | Notes | Visual browsers will display the size of the headings in relation to their importance, <h1> being the largest and <h6> being the smallest. |
<head>…</head>
Usage | This is the document header and it contains other elements that provide information to users and search engines. | Start/End Tag | Optional/Optional. | Attributes | i18n.
profile="url"
URL specifying the location of meta data. | Empty | No. | Notes | There can be only one <head> per document. It must follow the opening <html> tag and precede the <body>. |
<hr />
Usage | Horizontal rules are used to separate sections of a web page. | Start/End Tag | Required/Illegal. | Attributes | core, events, i18n. | Empty | Yes. |
<html>…</html>
Usage | The html element contains the entire document. | Start/End Tag | Optional/Optional. | Attributes | i18n. | Empty | No. | Notes | The version information is duplicated in the <!doctype...> declaration and is therefore not essential. |
<meta />
Usage | Provides information about the document. | Start/End Tag | Required/Illegal. | Attributes | i18n.
http-equiv="servercmd"
HTTP response header name.
name="name"
Name of the meta information.
content="value"
Content of the meta information.
scheme="scheme"
Assigns a scheme to interpret the meta data. | Empty | Yes. |
<span>…</span>
Usage | Organizes the document by defining a span of text. | Start/End Tag | Required/Required. | Attributes | core, i18n, events. | Empty | No. |
<title>…</title>
Usage | The name you give your web page. The <title> tag is placed in the <head> tag and is displayed in the browser window title bar. | Start/End Tag | Required/Required. | Attributes | i18n. | Empty | No. | Notes | Only one title allowed per document. |
|