Quick XHTML 1.0 strict reference sheet

This is a quick reference sheet for the XHTML 1.0 Strict markup language. It provides quick answers and references about elements and their attributes.

Sample document

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
	<head>
		<meta http-equiv="Content-type" content="text/html; charset=utf-8" />
		<title>Document title, site title</title>
		<link rel="stylesheet" type="text/css" href="_links/stylesheets/default.css" />
		<script type="text/javascript" src="_link/scripts/default.js"></script>
	</head>
	<body>
		<div id="document">
			<div id="header">
				<h2>Site title<h2>
				<ul id="navigation">
					<li><a href="/">Home</a></li>
				</ul>
			</div>

			<div id="content">
				<h1>Document title<h1>
				<p>Lorem ipsum dolar sit amet.</p>
			</div>

			<div id="footer">
				<p id="copyright">Section copyright<p>
			</div>
		</div>
	</body>
</html>
						

Elements

a
Defines an anchor.
%attrs;
Common attributes
%focus;
Focus attributes
charset
Character encoding of linked resource.
coords
Specifies the position and shape on the screen. The number and order of values depends on the shape being defined. Possible combinations:
rect
left-x, top-y, right-x, bottom-y.
circle
center-x, center-y, radius. Note. When the radius value is a percentage value, user agents should calculate the final radius value based on the associated object's width and height. The radius should be the smaller value of the two.
poly
x1, y1, x2, y2, ..., xN, yN. The first x and y coordinate pair and the last should be the same to close the polygon. When these coordinate values are not the same, user agents should infer an additional coordinate pair to close the polygon.
Coordinates are relative to the top, left corner of the object. All values are lengths. All values are separated by commas.
href
URI for linked resource.
hreflang
Specifies the base language code of the resource designated by href and may only be used when href is specified.
name
Deprecated. Use id instead.
rel
Describes the relationship from the current document to the anchor specified by the href attribute. The value of this attribute is a space-separated list of %link_types;.
rev
Used to describe a reverse link from the anchor specified by the href attribute to the current document. The value of this attribute is a space-separated list of %link_types;.
shape
Specifies the shape of a region. Possible values:
default
Specifies the entire region.
rect
Define a rectangular region.
circle
Define a circular region.
poly
Define a polygonal region.
type
This attribute gives an advisory hint as to the MIME content type of the content available at the link target address. It allows user agents to opt to use a fallback mechanism rather than fetch the content if they are advised that they will get content in a content type they do not support. Authors who use this attribute take responsibility to manage the risk that it may become inconsistent with the content available at the link target address.
abbr
Indicates an abbreviated form (e.g., WWW, HTTP, URI, Mass., etc.).
%attrs;
Common attributes
acronym
Indicates an acronym (e.g., WAC, radar, etc.).
%attrs;
Common attributes
address
Defines an address element
%attrs;
Common attributes
area
Defines an area inside an image map
%attrs;
Common attributes
%focus;
Focus attributes
alt required
Short description.
coords
Specifies the position and shape on the screen. The number and order of values depends on the shape being defined. Possible combinations:
rect
left-x, top-y, right-x, bottom-y.
circle
center-x, center-y, radius. Note. When the radius value is a percentage value, user agents should calculate the final radius value based on the associated object's width and height. The radius should be the smaller value of the two.
poly
x1, y1, x2, y2, ..., xN, yN. The first x and y coordinate pair and the last should be the same to close the polygon. When these coordinate values are not the same, user agents should infer an additional coordinate pair to close the polygon.
Coordinates are relative to the top, left corner of the object. All values are lengths. All values are separated by commas.
href
URI for linked resource.
nohref
When set, this boolean attribute specifies that a region has no associated link.
shape
Specifies the shape of a region. Possible values:
default
Specifies the entire region.
rect
Define a rectangular region.
circle
Define a circular region.
poly
Define a polygonal region.
b
Defines bold text
%attrs;
Common attributes
base
Defines a base URL for all the links in a page.
href required
URI for linked resource.
id
This attribute assigns a name to an element. This name must be unique in a document.
bdo
Defines the direction of text display
%coreattrs;
Core attributes
%events;
Events attributes
dir required
This attribute specifies the base direction of directionally neutral text (i.e., text that doesn't have inherent directionality as defined in UNICODE) in an element's content and attribute values. It also specifies the directionality of tables. Possible values:
ltr
Left-to-right text or table.
rtl
Right-to-left text or table.
lang
Specifies the base language code of an element's attribute values and text content. The default value of this attribute is unknown.
xml:lang
Language code (as per XML 1.0 spec).
big
Defines big text
%attrs;
Common attributes
blockquote
Defines a long quotation
%attrs;
Common attributes
cite
URI for linked resource.
body
Defines the body element
%attrs;
Common attributes
onload
The onload event occurs when the user agent finishes loading a window.
onunload
The onunload event occurs when the user agent removes a document from a window.
br
Inserts a single line break
%coreattrs;
Core attributes
button
Defines a push button
%attrs;
Common attributes
%focus;
Focus attributes
name
This attribute assigns the control name.
value
This attribute assigns the initial value to the button.
type
This attribute declares the type of the button. Possible values:
button
Creates a push button.
submit
Creates a submit button. This is the default value.
reset
Creates a reset button.
disabled
When set for a form control, this boolean attribute disables the control for user input.
caption
Defines a table caption
%attrs;
Common attributes
cite
Contains a citation or a reference to other sources.
%attrs;
Common attributes
code
Designates a fragment of computer code.
%attrs;
Common attributes
col
Defines attributes for table columns
%attrs;
Common attributes
span
This attribute, whose value must be an integer > 0, specifies the number of columns "spanned" by the COL element; the COL element shares its attributes with all the columns it spans. The default value for this attribute is 1 (i.e., the COL element refers to a single column). If the span attribute is set to N > 1, the current COL element shares its attributes with the next N-1 columns.
width
This attribute specifies a default width for each column spanned by the current COL element. It has the same meaning as the width attribute for the COLGROUP element and overrides it.
%cellhalign;
Cellhalign attributes.
%cellvalign;
Cellvalign attributes.
colgroup
Defines groups of table columns
%attrs;
Common attributes
span
This attribute, whose value must be an integer > 0, specifies the number of columns "spanned" by the COL element; the COL element shares its attributes with all the columns it spans. The default value for this attribute is 1 (i.e., the COL element refers to a single column). If the span attribute is set to N > 1, the current COL element shares its attributes with the next N-1 columns.
width
This attribute specifies a default width for each column spanned by the current COL element. It has the same meaning as the width attribute for the COLGROUP element and overrides it.
%cellhalign;
Cellhalign attributes.
%cellvalign;
Cellvalign attributes.
dd
Defines a definition description
%attrs;
Common attributes
del
Defines deleted text
%attrs;
Common attributes
cite
URI for linked resource.
datetime
The value of this attribute specifies the date and time when the change was made.
div
Defines a section in a document.
%attrs;
Common attributes
dfn
Indicates that this is the defining instance of the enclosed term.
%attrs;
Common attributes
dl
Defines a definition list
%attrs;
Common attributes
dt
Defines a definition term
%attrs;
Common attributes
em
Indicates emphasis.
%attrs;
Common attributes
fieldset
Defines a fieldset
%attrs;
Common attributes
form
Defines a form
%attrs;
Common attributes
action required
...
method
get
...
post
...
enctype
"application/x-www-form-urlencoded"
onsubmit
...
onreset
...
accept
...
accept-charset
...
h1
Defines header 1
%attrs;
Common attributes
h2
Defines header 2
%attrs;
Common attributes
h3
Defines header 3
%attrs;
Common attributes
h4
Defines header 4
%attrs;
Common attributes
h5
Defines header 5
%attrs;
Common attributes
h6
Defines header 6
%attrs;
Common attributes
Defines information about the document
hr
Defines a horizontal rule
%attrs;
Common attributes
html
Defines an html document
i
Defines italic text
%attrs;
Common attributes
img
Defines an image
%attrs;
Common attributes
input
Defines an input field
%attrs;
Common attributes
ins
Defines inserted text
%attrs;
Common attributes
kbd
Indicates text to be entered by the user.
%attrs;
Common attributes
label
Defines a label for a form control
%attrs;
Common attributes
legend
Defines a title in a fieldset
%attrs;
Common attributes
li
Defines a list item
%attrs;
Common attributes
Defines a resource reference
%attrs;
Common attributes
map
Defines an image map
meta
Defines meta information
noscript
Defines a noscript section
%attrs;
Common attributes
object
Defines an embedded object
%attrs;
Common attributes
ol
Defines an ordered list
%attrs;
Common attributes
optgroup
Defines an option group
%attrs;
Common attributes
option
Defines an option in a drop-down list
%attrs;
Common attributes
p
Defines a paragraph.
%attrs;
Common attributes
param
Defines a parameter for an object
pre
Defines preformatted text
%attrs;
Common attributes
q
Defines a short quotation
%attrs;
Common attributes
samp
Designates sample output from programs, scripts, etc.
%attrs;
Common attributes
script
Defines a script
select
Defines a selectable list
%attrs;
Common attributes
small
Defines small text
%attrs;
Common attributes
span
Defines a section in a document
%attrs;
Common attributes
strong
Indicates stronger emphasis.
%attrs;
Common attributes
style
Defines a style definition
sub
Defines subscripted text
%attrs;
Common attributes
sup
Defines superscripted text
%attrs;
Common attributes
table
Defines a table
%attrs;
Common attributes
tbody
Defines a table body
%attrs;
Common attributes
td
Defines a table cell
%attrs;
Common attributes
textarea
Defines a text area
%attrs;
Common attributes
tfoot
Defines a table footer
%attrs;
Common attributes
th
Defines a table header
%attrs;
Common attributes
thead
Defines a table header
%attrs;
Common attributes
title
Defines the document title
tr
Defines a table row
%attrs;
Common attributes
tt
Defines teletype text
%attrs;
Common attributes
ul
Defines an unordered list
%attrs;
Common attributes
var
Indicates an instance of a variable or program argument.
%attrs;
Common attributes

Common attributes

%coreattrs;
Core attributes
%events;
Events attributes
%i18n;
Internationalization

Core

class
This attribute assigns a class name or set of class names to an element. Any number of elements may be assigned the same class name or names. Multiple class names must be separated by white space characters.
id
This attribute assigns a name to an element. This name must be unique in a document.
style
This attribute specifies style information for the current element written in the default style sheet language defined by Content-Style-Type.

Events

onclick
A pointer button was clicked.
ondblclick
A pointer button was double clicked.
onkeydown
A key was pressed down.
onkeypress
A key was pressed and released.
onkeyup
A key was released.
onmousedown
A pointer button was pressed down.
onmousemove
A pointer was moved onto the element.
onmouseout
A pointer was moved away from the element.
onmouseover
A pointer was moved over the element.
onmouseup
A pointer button was released.

Internationalization

dir
This attribute specifies the base direction of directionally neutral text (i.e., text that doesn't have inherent directionality as defined in UNICODE) in an element's content and attribute values. It also specifies the directionality of tables. Possible values:
ltr
Left-to-right text or table.
rtl
Right-to-left text or table.
lang
Specifies the base language code of an element's attribute values and text content. The default value of this attribute is unknown.
xml:lang
Language code (as per XML 1.0 spec).

Focus attributes

accesskey
Accessibility key character.
tabindex
Position in tabbing order.
onblur
The element lost the focus.
onfocus
The element got the focus.

Link types

Authors may use the following recognized link types, listed here with their conventional interpretations. In the DTD, %LinkTypes 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.

Authors may wish to define additional link types not described in this specification. If they do so, they should use a profile to cite the conventions used to define the link types. Please see the profile attribute of the HEAD element for more details.