This document is also available in these non-normative formats: Single XHTML file , PostScript version , PDF version , ZIP archive , and Gzip'd TAR archive .
Copyright ©2002 W3C ® ( MIT , INRIA , Keio ), All Rights Reserved. W3C liability , trademark , document use and software licensing rules apply.
This Working Draft specifies the XHTML 2.0 markup language and a variety of XHTML-conforming modules that support that language.
This section describes the status of this document at the time of its publication. Other documents may supersede this document. The latest status of this document series is maintained at the W3C.
This document is the third public Working Draft of this specification. It was released very soon after the second public Working Draft because of production errors, and does not reflect any major changes from that draft. It should in no way be considered stable, and should not be referenced for any purposes whatsoever. This version does not include the implementations of XHTML 2.0 in either DTD or XML Schema form. Those will be included in subsequent versions, once the contents of this language stabilizes. This version also does not address the issues revolving around the use of [ XLINK ] by XHTML 2. Those issues are being worked independent of the evolution of this specification. Those issues should, of course, be resolved as quickly as possible, and the resolution will be reflected in a future draft.
This document has been produced by the W3C HTML Working Group ( members only ) as part of the W3C HTML Activity . The goals of the HTML Working Group are discussed in the HTML Working Group charter .
Public discussion of XHTML takes place on www-html@w3.org ( archive ). To subscribe send an email to www-html-request@w3.org with the word subscribe in the subject line.
Please report errors in this document to www-html-editor@w3.org ( archive ).
At the time of publication, the Working Group believed there were no patent disclosures relevant to this specification. A current list of patent disclosures relevant to this specification may be found on the Working Group's patent disclosure page .
A list of current W3C Recommendations and other technical documents can be found at http://www.w3.org/TR.
This section is informative .
XHTML 2 is a markup language intended for rich, portable web-based applications. While the ancestry of XHTML 2 comes from HTML 4, XHTML 1.0, and XHTML 1.1, it is not intended to be backward compatible with its earlier versions. Application developers familiar with its earlier ancestors will be comfortable working with XHTML 2. Appendix A describes the ways in which XHTML 2 differs from previous versions and what application developers need to know to convert existing applications to XHTML 2.
XHTML 2 is a member of the XHTML Family of markup languages. It is an XHTML Host Language as defined in XHTML Modularization. As such, it is made up of a set of XHTML Modules that together describe the elements and attributes of the language, and their content model. XHTML 2 updates many of the modules defined in XHTML Modularization 1.0 [ XHTMLMOD ], and includes the updated versions of all those modules and their semantics. XHTML 2 also uses modules from Ruby [ RUBY ], XML Events [ XMLEVENTS ], and XForms [ XFORMS ].
The modules defined in this specification are largely extensions of the modules defined in XHTML Modularization 1.0. This specification also defines the semantics of the modules it includes. So, that means that unlike earlier versions of XHTML that relied upon the semantics defined in HTML 4, all of the semantics for XHTML 2 are defined either in this specification or in the specifications that it normatively references.
Even though the XHTML 2 modules are defined in this specification, they are available for use in other XHTML family markup languages. Over time, it is possible that the modules defined in this specification will migrate into the XHTML Modularization specification.
This section is informative .
While some terms are defined in place, the following definitions are used throughout this document. Familiarity with the W3C XML 1.0 Recommendation [ XML ] is highly recommended.
This section is normative .
The keywords "MUST", "MUST NOT", "REQUIRED", "SHALL", "SHALL NOT", "SHOULD", "RECOMMENDED", "MAY", and "OPTIONAL" in this document are to be interpreted as described in [ RFC2119 ].
DTD Bias
This section has a distinct DTD bias. We need to make it clear that either the DTD or the Schema can be used to validate XHTML 2.0 documents.
A strictly conforming XHTML 2.0 document is a document that requires only the facilities described as mandatory in this specification. Such a document must meet all the following criteria:
The document must conform to the constraints expressed in Appendix B - XHTML 2.0 Schema or Appendix D - XHTML 2.0 Document Type Definition .
The root element of the document must be html .
The root element of the document must contain an
xmlns declaration for the XHTML 2.0 namespace [ XMLNAMES ]. The namespace for XHTML
is defined to be http://www.w3.org/2002/06/xhtml2 . An
example root element might look like:
<html xmlns="http://www.w3.org/2002/06/xhtml2" xml:lang="en">
There must be a DOCTYPE declaration in the document prior to the root element. If present, the public identifier included in the DOCTYPE declaration must reference the DTD found in Appendix E using its Formal Public Identifier. The system identifier may be modified appropriately.
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 2.0//EN" "TBD">
Here is an example of an XHTML 2.0 document.
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 2.0//EN"
"TBD">
<html xmlns="http://www.w3.org/2002/06/xhtml2" xml:lang="en">
<head>
<title>Virtual Library</title>
</head>
<body>
<p>Moved to <a href="http://vlib.org/">vlib.org</a>.</p>
</body>
</html>
Note that in this example, the XML declaration is included. An XML declaration like the one above is not required in all XML documents. XHTML document authors are strongly encouraged to use XML declarations in all their documents. Such a declaration is required when the character encoding of the document is other than the default UTF-8 or UTF-16 and no encoding was determined by a higher-level protocol.
A conforming user agent must meet all user agent conformance requirements defined in [ XHTMLMOD ].
This section is normative .
The XHTML 2.0 document type is a fully functional document type with rich semantics. It is a collection of XHTML-conforming modules (most of which are defined in this specification). The Modules and their elements are listed here for information purposes, but the definitions in their base documents should be considered authoritative. In the on-line version of this document, the module names in the list below link into the definitions of the modules within the relevant version of the authoritative specification.
Need XHTML 2.0 Definition Table
We need a table that defines the modules that are in XHTML 2.0 and links them into this document. Currently, that will be a bunch of modules that are in this document, and modules from XML Events, Ruby, and XForms. The table below is largely correct, but is still just a place holder.
body, head, html, titleabbr, address, blockquote, code, dfn, div, em, h, h1, h2,
h3, h4, h5, h6, kbd, l, p, pre, quote, samp, section, span, strong,
varadl, dt, dd, name, nl, ol, ul, liarea, maplinkmetaobject, paramhr, sub, supnoscript, scriptstyle elementtarget attributecaption, col, colgroup, table, tbody, td, tfoot, th,
thead, trXHTML 2.0 also uses the following externally defined modules:
ruby, rbc, rtc, rb, rt, rplistenerThere are no additional definitions required by this document type. An implementation of this document type as an XML Schema is defined in Appendix B , and as a DTD in Appendix D .
This section is normative .
This document defines a variety of XHTML modules and the semantics of those modules. This section describes the conventions used in those module definitions.
Each module in this document is structured in the following way:
Note that attributes are fully defined only the first time they are used in each module. After that, only a brief description of the attribute is provided, along with a link back to the primary definition.
An abstract module is a definition of an XHTML module using prose text and some informal markup conventions. While such a definition is not generally useful in the machine processing of document types, it is critical in helping people understand what is contained in a module. This section defines the way in which XHTML abstract modules are defined. An XHTML-conforming module is not required to provide an abstract module definition. However, anyone developing an XHTML module is encouraged to provide an abstraction to ease in the use of that module.
The abstract modules are not defined in a formal grammar. However, the definitions do adhere to the following syntactic conventions. These conventions are similar to those of XML DTDs, and should be familiar to XML DTD authors. Each discrete syntactic element can be combined with others to make more complex expressions that conform to the algebra defined here.
expr ?expr +expr *a , ba is required, followed by expression
b .a | ba - b& ).* ).| ), inside of
parentheses following the attribute name. If the attribute has a
default value, that value is followed by an asterisk (
* ). If the attribute has a fixed value, the attribute name
is followed by an equals sign ( = ) and the fixed
value enclosed in quotation marks.Abstract module definitions define minimal, atomic content models for each module. These minimal content models reference the elements in the module itself. They may also reference elements in other modules upon which the abstract module depends. Finally, the content model in many cases requires that text be permitted as content to one or more elements. In these cases, the symbol used for text is PCDATA . This is a term, defined in the XML 1.0 Recommendation, that refers to processed character data. A content type can also be defined as EMPTY , meaning the element has no content in its minimal content model.
In some instances, it is necessary to define the types of attribute values or the explicit set of permitted values for attributes. The following attribute types (defined in the XML 1.0 Recommendation) are used in the definitions of the abstract modules:
| Attribute Type | Definition |
|---|---|
| CDATA | Character data |
| ID | A document-unique identifier |
| IDREF | A reference to a document-unique identifier |
| IDREFS | A space-separated list of references to document-unique identifiers |
| NAME | A name with the same character constraints as ID above |
| NMTOKEN | A name composed of only name tokens as defined in XML 1.0 [ XML ]. |
| NMTOKENS | One or more white space separated NMTOKEN values |
| PCDATA | Processed character data |
In addition to these pre-defined data types, XHTML Modularization defines the following data types and their semantics (as appropriate):
| Data type | Description |
|---|---|
| Character | A single character, as per section 2.2 of [ XML ]. |
| Charset | A character encoding, as per [ RFC2045 ]. |
| Charsets | A space-separated list of character encodings, as per [ RFC2045 ]. |
| ClassName | Used by the class attribute, ClassNames are tokens that identify an element as being a member of the set named by the value of the class attribute. ClassName attribute tokens must begin with a letter ([A-Za-z]) and may be followed by any number of letters, digits ([0-9]), hyphens ("-"), underscores ("_"), colons (":"), and periods ("."). |
| ContentType | A list of media ranges with optional accept parameters, as defined in section 14.1 of [ RFC2616 ] as the field value of the accept request header. |
| Coordinates | Comma separated list of Length s used in defining areas. |
| Datetime | Date and time information. |
| FPI | A character string representing an SGML Formal Public Identifier. |
| HrefTarget | Window name used as destination for results of certain actions. |
| LanguageCode | A language code, as per [ RFC3066 ]. |
| Length | The value may be either in pixels or a percentage of the available horizontal or vertical space. Thus, the value "50%" means half of the available space. |
| LinkTypes | Authors may use the following recognized link types, listed
here with their conventional interpretations. A LinkTypes value
refers to a space-separated list of link types. White space
characters are not permitted within link types.
These link types are case-insensitive, i.e., "Alternate" has the same meaning as "alternate". User agents, search engines, etc. may interpret these link types in a variety of ways. For example, user agents may provide access to linked documents through a navigation bar.
Linktype 'required' Linktype 'required'Linktype 'prefetch' Linktype 'prefetch' |
| MediaDesc |
A comma-separated list of media descriptors as described by [ CSS2 ]. The default is |
| Number | One or more digits |
| Shape | The shape of a region. |
| Text | Arbitrary textual data, likely meant to be human-readable. |
| URI | A Uniform Resource Identifier Reference, as defined by the type
anyURI in [
XMLSCHEMA ] (called IRI in some other specifications). |
| URIs | A space-separated list of URIs as defined above. |
| URI List | A comma-separated list of URIs as defined above. |
This section is normative .
Many of the abstract modules in this document define the required attributes for their elements. The table below defines some collections of attributes that are referenced throughout the modules. These expressions should in no way be considered normative or mandatory. They are an editorial convenience for this document. When used in the remainder of this section, it is the expansion of the term that is normative, not the term itself.
The following basic attribute sets are used on many elements. In each case where they are used, their use is identified via their collection name.
The class attribute can be used for different purposes in XHTML, for instance as a style sheet selector (when an author wishes to assign style information to a set of elements), and for general purpose processing by user agents.
For instance in the following example, the p element is used in conjunction with the class attribute to identify a particular type of paragraph.
<p class="note"> These programs are only available if you have purchased the advanced professional suite. </p>
Style sheet rules can then be used to render the paragraph appropriately, for instance by putting a border around it, giving it a different background colour, or where necessary by not displaying it at all.
The id attribute has several roles in XHTML:
As an example, the following headings are distinguished by their id values:
<h id="introduction">Introduction</h> <p>...</p> <h id="events">The Events Module</h> <p>...</p>
Values of the title attribute may be rendered by user agents in a variety of ways. For instance, visual browsers should display the title as a "tool tip" (a short message that appears when the pointing device pauses over an object). Audio user agents may speak the title information in a similar context.
Example of the use of title :
<a href="/Jakob/" title="Author biography">Jakob Nielsen</a>'s Alertbox for January 11, 1998
The title attribute has an additional role when used with the link element to designate an external style sheet. See the section on links and style sheets for details.
'root'
A 'root of word' attribute for commonAn element inherits language code information according to the following order of precedence (highest to lowest):
In this example, the primary language of the document is French ("fr"). One paragraph is declared to be in US English ("en-us"), after which the primary language returns to French. The following paragraph includes an embedded Japanese ("ja") phrase, after which the primary language returns to French.
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 2.0//EN"
"TBD">
<html xmlns="http://www.w3.org/2002/06/xhtml2" xml:lang="fr">
<head>
<title>Un document multilingue</title>
</head>
<body>
<p>...Interpreted as French...</p>
<p xml:lang="en-us">...Interpreted as US English...</p>
<p>...Interpreted as French again...</p>
<p>...French text interrupted by<em xml:lang="ja">some
Japanese</em>French begins here again...</p>
</body>
</html>
*[dir="ltr"] { unicode-bidi: normal; direction: ltr}
*[dir="rtl"] { unicode-bidi: normal; direction: rtl}
*[dir="lro"] { unicode-bidi: bidi-override; direction: ltr}
*[dir="rlo"] { unicode-bidi: bidi-override; direction: rtl}
Example:
improve bidi example
<p dir="ltr"> I received the following email: <l dir="lro">english werbeh english</l> <l dir="lro">werbeh english werbeh</l> </p>
This collection allows elements to carry information indicating how, when and why content has changed.
inserted and deletedThe default presentation for an element with
edit="deleted" is display: none (in other
words, it is not displayed) although an alternate style might
display it as crossed through. The other three values cause no
special presentation by default, though an alternate style might
use background colors or other text decoration to indicate the
changed text.
Example:
I will do it next week month .
Example:
datetime="2003-01-13T13:15:30Z"
Example:
cite="comments.html"
This collection allows an element to be the start point of a hypertext link to a remote resource.
Examples:
<abbr href="http://www.w3.org/" title="World Wide Web">WWW</abbr> <li href="contents.xhtml">contents</li> <span href="http://www.cwi.nl/~steven/amsterdam.html">Amsterdam</span> <quote href="hamlet.xhtml#p2435">To be or not to be</quote> <var href="#index_ninc">ninc</var>
Example:
<abbr title="World Wide Web" href="http://www.w3.org/">WWW</abbr>
This specification does not define how this attribute gets used, since that is defined by the environment that the hyperlink is actuated in. See for instance XFrames [ XFRAMES ].
Example:
<a href="home.html" target="main">Home</a>
Pressing an access key assigned to an element gives focus to the element. The action that occurs when an element receives focus depends on the element. For example, when a user activates a link defined by the a element, the user agent generally follows the link. When a user activates a radio button, the user agent changes the value of the radio button. When the user activates a text field, it allows input, etc.
In this example, we assign the access key "C" to a link. Typing this access key takes the user to another document, in this case, a table of contents.
<p accesskey="C" rel="contents" href="http://example.com/specification/contents.html"> Table of Contents </p>
The invocation of access keys depends on the underlying system. For instance, on machines running MS Windows, one generally has to press the "alt" key in addition to the access key. On Apple systems, one generally has to press the "cmd" key in addition to the access key.
The rendering of access keys depends on the user agent. We recommend that authors include the access key in label text or wherever the access key is to apply. User agents should render the value of an access key in such a way as to emphasize its role and to distinguish it from other characters (e.g., by underlining it).
Accesskey
Actuation of elements with accesskeyThe navigation order defines the order in which elements will receive focus when navigated by the user via the keyboard. The navigation order may include elements nested within other elements.
Elements that may receive focus should be navigated by user agents according to the following rules:
When a document is loaded using a URL that includes a fragment
reference (such as book.html#chapter5 ) navigation
begins at the point the fragment begins. If the user has moved away
from that point (for instance using page up or page down), the
navigation starting point is undefined.
The following example would allow the links to be navigated in
column order (without the use of navindex they would
be navigated in document, i.e. row, order):
<table>
<tr><td href="a" navindex="1">NW</td>
<td href="c" navindex="3">NE</td></tr>
<tr><td href="b" navindex="2">SW</td>
<td href="d" navindex="4">SE</td></tr>
</table>
Navigation keys. The actual key sequence that causes navigation or element activation depends on the configuration of the user agent (e.g., the "tab" key might be used for navigation and the "enter" key or "space" key used to activate a selected element).
User agents may also define key sequences to navigate the navigation order in reverse. When the end (or beginning) of the navigation order is reached, user agents may circle back to the beginning (or end).
An element inherits URI base information according to the following order of precedence (highest to lowest):
Example:
See:
<ul xml:base="http://www.w3.org">
<li href="/">The W3C home page</li>
<li href="/TR">The W3C Technical Reports page</li>
<li href="/Markup">The HTML home page</li>
<li href="/Markup/Forms">The XForms home page</li>
</ul>
This collection causes the contents of a remote resource to be embedded in the document in place of the element's content. If accessing the remote resource fails, for whatever reason (network unavailable, no resource available at the URI given, inability of the user agent to process the type of resource) the content of the element must be processed instead.
Examples:
<p src="holiday.png" type="image/png">
<span src="holiday.gif" type="image.gif">
An image of us on holiday.
</span>
</p>
This attribute specifies the allowable content types of the relevant src URI. At its most general, it is a comma-separated list of media ranges with optional accept parameters, as defined in section 14.1 of [ RFC2616 ] as the field value of the accept request header.
In its simplest case, this is just a media type, such as "image/png" or "application/xml", but it may also contain asterisks, such as "image/*" or "*/*", or lists of acceptable media types, such as "image/png, image/gif, image/jpeg".
The user agent must take this list, and combine it with its own list of acceptable media types by taking the intersection, and then use the resulting list as the field value of the accept request header when requesting the resource.
For instance, if the attribute specifies the value "image/png, image/gif, image/jpeg", but the user agent does not accept images of type "image/gif" then the resultant accept header would contain "image/png, image/jpeg".
If this attribute is not present, "*/*" is used for its value.
For the current list of registered content types, please consult [ MIMETYPES ].
Examples:
<script src="pop" type="application/x-javascript, text/x-newspeak"/> <style src="midnight" type="text/css, text/x-mystyle"/> <p src="w3c-logo" type="image/png, image/jpeg;q=0.2">W3C logo</p> <span src="logo.png">Our logo</span>
This collection adds attributes that specify that an embedded image may be used as an image map, so that clicking on different parts of the image causes different hyperlinks to be activated.
In the following example, the active region defines a server-side link. Thus, a click anywhere on the image will cause the click's coordinates to be sent to the server.
<p href="http://www.example.com/cgi-bin/map"
src="map.png" ismap="ismap">
Our location.
</p>
The location clicked is passed to the server as follows. The user agent derives a new URI from the URI specified by the href attribute of the a element, by appending `?' followed by the x and y coordinates, separated by a comma. The link is then followed using the new URI. For instance, in the given example, if the user clicks at the location x=10, y=27 then the derived URI is "http://www.example.com/cgi-bin/competition?10,27".
User agents that do not offer the user a means to select specific coordinates (e.g., non-graphical user agents that rely on keyboard input, speech-based user agents, etc.) should send the coordinates "0,0" to the server when the link is activated.
Coordinates are relative to the top, left corner of the object. All values are of type Length . All values are separated by commas.
Note that in the following example, if the image is unavailable for any reason, the fallback properties of the href attribute mean that the <nl> will be displayed instead of the image, thus making the page still useful:
<html xmlns="http://www.w3.org/2002/06/xhtml2">
<head>
<title>The cool site!</title>
</head>
<body>
<p src="navbar1.png" type="image/png" usemap="#map1">
<map id="map1">
<nl>
<label>Navigate the site:</label>
<li href="guide.html" shape="rect" coords="0,0,118,28">
Access Guide</li>
<li href="shortcut.html" shape="rect" coords="118,0,184,28">
Go</li>
<li href="search.html" shape="circle" coords="184,200,60">
Search</li>
<li href="top10.html" shape="poly" coords="276,0,276,28,100,200,50,50,276,0">
Top Ten</li>
</nl>
</map>
</p>
</body>
</html>
Note that an li in an nl is not required to have an href attribute. In that case, the relevant region of the image is inactive:
<p href="image.png" type="image/png" usemap="#map1"> <nl id="map1"> <li shape="circle" coords="100,200,50">I'm inactive.</li> <li href="outer-ring-link.html" shape="circle" coords="100,200,250">I'm active.</li> </nl> </p>
Allow any element to be an image map?
Should we allow any element (such as <p>) that contains a number of hyperlinks to be an image map?ismap
Can we define ismap better?Require UA to give feedback on regions
Should a UA be required to give feedback on the regions when hovering?The global attributes from [ XMLEVENTS ] are included in the Events attribute collection. The normative definition of those attributes and their semantics is included in that specification. They are described briefly below:
List of XHTML 2 Events Needed
We need to define the list of XHTML 2 events and map them into the XHTML DOM. activate, load, focusIn, focusOut, ...Note that these attributes are not in the XHTML namespace. Instead, they are in the XML Events namespace. The XHTML namespace is the default namespace for XHTML documents, so XHTML elements and attributes do not require namespace prefixes (although they are permitted). XML Events attributes MUST use a prefix, since they are not in the default namespace of the document.
This collection assembles the Core , I18N , Events , Edit , Embedding , Bi-directional , and Hypertext attribute collections defined above.
This section is normative .
The Structure Module defines the major structural elements for XHTML. These elements effectively act as the basis for the content model of many XHTML family document types. The elements and attributes included in this module are:
| Elements | Attributes | Minimal Content Model |
|---|---|---|
| html | Common , profile ( URI ), xmlns ( URI = "http://www.w3.org/2002/06/xhtml2") | head , body |
| head | Common | title |
| title | Common | PCDATA |
| body | Common | (Heading | Block | List)* |
This module is the basic structural definition for XHTML
content. The html element acts as the root element for
all XHTML Family Document Types.
Note that the value of the xmlns attribute is defined to be "http://www.w3.org/2002/06/xhtml2". Also note that because the xmlns attribute is treated specially by XML namespace-aware parsers [ XMLNAMES ], it is legal to have it present as an attribute of each element. However, any time the xmlns attribute is used in the context of an XHTML module, whether with a prefix or not, the value of the attribute shall be the XHTML namespace defined here.
Implementation: DTD
footer PR #744
There was a suggestion for a footer element to contain data that should be presented at the bottom of content. The working group has not yet addressed this suggestion.security tag
There was a suggestion that we define a security tag, within which elements that have security ramifications would be rendered harmless. The working group has not yet addressed this suggestion.After the document type declaration, the remainder of an XHTML document is contained by the html element.
Attributes
Example:
<html class="slideshow">
The head element contains information about the current document, such as its title, keywords that may be useful to search engines, and other data that is not considered document content. The default presentation of the head is not to display it; however that can be overridden with a stylesheet for special purpose use. User agents may however make information in the head available to users through other mechanisms.
Attributes
Example:
<head>
<title>My Life</title>
</head>
Every XHTML document must have a title element in the head section.
Attributes
The title element is used to identify the document. Since documents are often consulted out of context, authors should provide context-rich titles. Thus, instead of a title such as "Introduction", which doesn't provide much contextual background, authors should supply a title such as "Introduction to Medieval Bee-Keeping" instead.
For reasons of accessibility, user agents must always make the content of the title element available to users. The mechanism for doing so depends on the user agent (e.g., as a caption, spoken).
Titles may contain entity references (for accented characters, special characters, etc.), but may not contain other markup (including comments). Example:
<title>A study of population dynamics</title>
duplication of title
Duplicating title and headingsThe body of a document contains the document's content. The content may be presented by a user agent in a variety of ways. For example, for visual browsers, you can think of the body as a canvas where the content appears: text, images, colors, graphics, etc. For audio user agents, the same content may be spoken.
Attributes
This section is normative .
This module defines all of the basic text container elements, attributes, and their content model:
| Element | Attributes | Minimal Content Model |
|---|---|---|
| abbr | Common | (PCDATA | Inline)* |
| address | Common | (PCDATA | Inline)* |
| blockquote | Common | (PCDATA | Inline | Heading | Block | List)* |
| code | Common | (PCDATA | Inline)* |
| dfn | Common | (PCDATA | Inline)* |
| div | Common | (PCDATA | Flow)* |
| em | Common | (PCDATA | Inline)* |
| h | Common | (PCDATA | Inline)* |
| h1 | Common | (PCDATA | Inline)* |
| h2 | Common | (PCDATA | Inline)* |
| h3 | Common | (PCDATA | Inline)* |
| h4 | Common | (PCDATA | Inline)* |
| h5 | Common | (PCDATA | Inline)* |
| h6 | Common | (PCDATA | Inline)* |
| kbd | Common | (PCDATA | Inline)* |
| l | Common | (PCDATA | Inline)* |
| p | Common | (PCDATA | Inline | List | blockquote | pre | table)* |
| pre | Common | (PCDATA | Inline)* |
| quote | Common | (PCDATA | Inline)* |
| samp | Common | (PCDATA | Inline)* |
| section | Common | (PCDATA | Flow)* |
| span | Common | (PCDATA | Inline)* |
| strong | Common | (PCDATA | Inline)* |
| var | Common | (PCDATA | Inline)* |
split text module
Text module should be split into inline and block submodulesl element content model
Content model of the l element (no nested lines)The minimal content model for this module defines some content sets:
Note that the use of the words Block and
Inline here are meant to be suggestive of the role the content
sets play. They are not normative with regards to presentation
since a style sheet might give any element within the Block content
a display property of inline .
Implementation: DTD
nr element
There was a suggestion to introduce annr element to
help annotate content as being a number. This suggestion has not
yet been addressed by the working group.The abbr element indicates that a text fragment is an abbreviation; this includes acronyms (e.g., W3C, XML, Inc., Ltd., Mass., etc.).
Attributes
The content of the abbr element specifies the abbreviated expression itself, as it would normally appear in running text. The title attribute of these elements may be used to provide the full or expanded form of the expression.
Note that abbreviations often have idiosyncratic pronunciations. For example, while "IRS" and "BBC" are typically pronounced letter by letter, "NATO" and "UNESCO" are pronounced phonetically. Still other abbreviated forms (e.g., "URI" and "SQL") are spelled out by some people and pronounced as words by other people. When necessary, authors should use style sheets to specify the pronunciation of an abbreviated form.
Examples:
<abbr title="Limited">Ltd.</abbr> <abbr title="Abbreviation">abbr.</abbr>
The address element may be used by authors to supply contact information for a document or a major part of a document such as a form. This element often appears at the beginning or end of a document.
address
Content model of address elementAttributes
For example:
<address href="mailto:webmaster@example.net">Webmaster </address>
This element designates a block of quoted text.
Attributes
This example formats an excerpt from "The Two Towers", by J.R.R. Tolkien, as a blockquote.
<blockquote cite="http://www.example.com/tolkien/twotowers.html"> <p>They went in single file, running like hounds on a strong scent, and an eager light was in their eyes. Nearly due west the broad swath of the marching Orcs tramped its ugly slot; the sweet grass of Rohan had been bruised and blackened as they passed.</p> </blockquote>
The code element contains a fragment of computer code.
Attributes
Example:
The <code>code</code> element contains a fragment of computer code.
The dfn element contains the defining instance of the enclosed term.
Attributes
Example:
An <dfn id="def-acronym">acronym</dfn> is a word formed from the initial letters or groups of letters of words in a set phrase or series of words.
The div element, in conjunction with the id and class attributes, offers a generic mechanism for adding extra structure to documents. This element defines no presentational idioms on the content. Thus, authors may use this element in conjunction with style sheets , the xml:lang attribute, etc., to tailor XHTML to their own needs and tastes.
Attributes
For example, suppose you wish to make a presentation in XHTML,
where each slide is enclosed in a separate element. You could use a
div element, with a class of
slide :
<body>
<h>The meaning of life</h>
<p>By Huntington B. Snark</p>
<div class="slide">
<h>What do I mean by "life"</h>
<p>....</p>
</div>
<div class="slide">
<h>What do I mean by "mean"?</h>
...
</div>
...
</body>
The em element indicates emphasis for its contents.
Attributes
Example:
Do <em>not</em> phone before 9 a.m.
A heading element briefly describes the topic of the section it introduces. Heading information may be used by user agents, for example, to construct a table of contents for a document automatically.
Deprecate h1-6?
There was a suggestion that h1 - h6 be deprecated. The working group has not yet addressed this suggestion.Attributes
There are two styles of headings in XHTML: the numbered versions h1 , h2 etc., and the structured version h , which is used in combination with the section element.
There are six levels of numbered headings in XHTML with h1 as the most important and h6 as the least. The visual presentation of headers can render more important headings in larger fonts than less important ones.
Structured headings use the single h element, in combination with the section element to indicate the structure of the document, and the nesting of the sections indicates the importance of the heading. The heading for the section is the one that is a child of the section element.
For example:
<body>
<h>This is a top level heading</h>
<p>....</p>
<section>
<p>....</p>
<h>This is a second-level heading</h>
<p>....</p>
<h>This is another second-level heading</h>
<p>....</p>
</section>
<section>
<p>....</p>
<h>This is another second-level heading</h>
<p>....</p>
<section>
<h>This is a third-level heading</h>
<p>....</p>
</section>
</section>
These visual representation of these levels can be distinguished in a style sheet:
h {font-family: sans-serif; font-weight: bold; font-size: 200%}
section h {font-size: 150%} /* A second-level heading */
section section h {font-size: 120%} /* A third-level heading */
etc.
Numbered sections and references
XHTML does not itself cause
section numbers to be generated from headings. Style
sheet languages such as CSS however allow authors to control the
generation of section numbers.
The practice of skipping heading levels is considered to be bad practice. The series h1 h2 h1 is acceptable, while h1 h3 h1 is not, since the heading level h2 has been skipped.
The kbd element indicates text to be entered by the user.
Attributes
Example:
To exit, type <kbd>QUIT</kbd>.
The l element contains a sub-paragraph that represents a sinle
line of text. It is intended as a structured replacement for
the br element. It contains a piece of text that when
visually represented should start on a new line, and have a line
break at the end. Whether the line should wrap or not visually
depends on styling properties of the element.
Attributes
By retaining structure in text that has to be broken over lines, you retain essential information about its makeup. This gives you greater freedom with styling the content. For instance, line numbers can be generated automatically from the stylesheet if needed.
For instance, for a document with the following structure:
<p class="program">
<l>program p(input, output);</l>
<l>begin</l>
<l> writeln("Hello world");</l>
<l>end.</l>
</p>
the following CSS stylesheet would number each line:
.program { counter-reset: linenumber }
l:before {
position: relative;
left: -1em;
counter-increment: linenumber;
content: counter(linenumber);
}
The p element represents a paragraph.
In comparison with earlier versions of HTML, where a paragraph could only contain inline text, XHTML2's paragraphs represent the conceptual idea of a paragraph, and so may contain lists, blockquotes, pre's and tables as well as inline text. They may not, however, contain directly nested p elements.
Attributes
<p>Payment options include: <ul> <li>cash</li> <li>credit card</li> <li>luncheon vouchers.</li> </ul> </p>
The pre element indicates that whitespace in the enclosed text has semantic relevance, and will normally be included in renderings of the content
Note that all elements in the XHTML family preserve their whitespace in the document, which is only removed on rendering, via a stylesheet, according to the rules of CSS [CSS]. This means that in principle all elements may preserve or collapse whitespace on rendering, under control of a stylesheet. Also note that there is no requirement that the <pre> element be rendered in a monospace font (although this is the default rendering), nor that text wrapping be disabled.
Attributes
Non-visual user agents are not required to respect extra white space in the content of a pre element.
The following example shows a preformatted verse from Shelly's poem To a Skylark :
<pre>
Higher still and higher
From the earth thou springest
Like a cloud of fire;
The blue deep thou wingest,
And singing still dost soar, and soaring ever singest.
</pre>
Here is how this might be rendered:
Higher still and higher
From the earth thou springest
Like a cloud of fire;
The blue deep thou wingest,
And singing still dost soar, and soaring ever singest.
This element designates an inline text fragment of quoted text.
Attributes
Visual user agents must not add delimiting quotation marks (as
was the case for the q element in earlier versions of
XHTML). It is the responsibility of the document author to add any
required quotation marks.
The following example illustrates nested quotations with the quote element.
<p>John said, <quote>"I saw Lucy at lunch, she told me <quote>'Mary wants you to get some ice cream on your way home.'</quote> I think I will get some at Jen and Berry's, on Gloucester Road."</quote></p>
Here is an example using the cite attribute:
Steven replied: <quote cite="http://lists.example.org/Public/www-html/June2002/0001.html">We quite agree</quote>
The sa