XHTML Reference Guide

Document Type Namespace Description
Transitional <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN">
The more forgiving, more backwards-compatible version of XHTML
Strict <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN">
The more rigorous, more XML-style version of XHTML
Frameset <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Frameset//EN">
DTD for frames

Most commonly used tags in XHTML

Basic tags
<html> Creates an XHTML document
<head> Defines the title and other information that is not part of the Web page itself
<body> Defines the Web page itself
Head tags
<title> (mandatory) Defines the page title, usually displayed in the browser's title bar
<base href="URI" /> Defines the base URL for this page
Block tags
<p>...</p> Defines a text paragraph.
<br /> Defines a forced linebreak.
<blockquote> Defines a quoted, indented text block.
<h1>...<h6> Defines a level 1-6 heading.
<div> Defines a page section.
<table> Defines a tabular section.
<form> Defines a Web form.
<ol> Defines an ordered list (1, 2, 3, ...).
<ul> Defines an unordered, bulleted list.
<li>...</li> Defines a list item in an ordered or unordered list.
<dl> Defines a definition list, with terms and their definitions.
<dt> Marks the term to be defined.
<dd> Marks the definition of the term.
Text formatting tags
<code>, <tt> Defines a fixed width font, teletype typewriter style.
<em>, <cite>, <i> Emphasises or cites a text passage, usually using italics.
<strong>, <b> Uses strong, boldface font.
<pre> Defines pre-formatted text, text flow not to be controlled by browser.
<font size="#" color="rgb"> Defines a new font for a text region.
Anchor tags (links)
<a href="url"> Defines a hyperlink to another Web page.
<a href="mailto:email@domain.tld"> Defines a hyperlink to an email recipient.
<a name="String"> Defines an anchor within the page.
<a href="#String"> Defines a hyperlink to an anchor on the same page.
Graphics tags
<img src="url" /> Includes an image from the given URL.
<hr /> Includes a horizontal rule.
<hr noshade="noshade" /> Includes a horizontal rule without a shadow.
Table tags
<table> Defines a table.
<tr> Defines a new table row.
<td> Defines a new table cell.
<th> Defines a new table header cell.
Table attributes
<table border="#" width="{#|%}"> Defines table border in pixels and width in pixels or percent.
<tr align="{left|center|right}" valign="{top|middle|bottom}"> Defines horizontal and vertical alignment of a row.
<td align="{left|center|right}" valign="{top|middle|bottom}"> Defines horizontal and vertical alignment of a cell.
<td colspan="#" rowspan="#"> Defines how many rows or columns a cell should span, default is 1.
<td nowrap="nowrap"> Defines a new table cell.
Frame tags
<frameset> Defines a set of frames.
<frameset rows="{#|%|*},{#|%|*}"> Defines rows in the set, either in pixels,
percentage of width, or spanning the rest (*).
<frameset cols="{#|%|*},{#|%|*}"> Defines columns in the set, either in pixels,
percentage of width, or spanning the rest (*).
<frame src="url" name="String" /> Defines a frame with a name and the URL for its content.
<noframes> Alternative information for browsers without frame support.
Form tags
<form action="url"> Defines a form. The action is mandatory and indicates the URL to be executed on submission.
<select name="String"> Defines a drop-down box, with enclosing options as items.
<select name="String" multiple="multiple" size="#"> Defines a multi-select box with {size} entries height, with enclosing options as items.
<option name="String">value</option> Defines items in select boxes.
<textarea cols="#" rows=#"> Defines a multiline text field with cols times rows characters.
<input type="text" name="String" /> Defines a single line text entry field.
<input type="checkbox" name="String" /> Defines a checkbox. The text for the checkbox follows the tag.
<input type="radio" name="String" value="String" /> Defines a radio button. The text for the button follows the tag.
Buttons with the same name form a group of mutual exclusive buttons.
<input type="image" border="#" name="String" src="url" /> Defines a submit button using an image.
<input type="submit" value="String" /> Defines a submit button using value as the face text.
<input type="reset" /> Defines a button that resets the form to blank entries.
Key
#Integer number, usually pixels, sometimes characters
%Integer percentage value, followed by a percent sign
StringString of alphanumeric characters, starting with a letter
rgbColor, specified by name ("black") or as RGB value ("#001122")
urlURL, usually http:// or file://