XHTML strict reference sheet
This is a quick guide to all of the XHTML elements that are in the strict document type, this is not intended to be a tutorial - these can be found on the XHTML tutorials page.
Download the PDF version of this reference guide [34.4KB].
The basics
Description: XHTML basic elements
| Name |
Element |
Comments |
| XHTML content |
<html></html> |
The start and end of a file |
| Header |
<head></head> |
Contains hidden page information |
| Title |
<title></title> |
Contained in the header |
| Body |
<body></body> |
Contains visible page elements |
Links
Description: XHTML link elements
| Name |
Element |
Comments |
| Link to another page |
<a href="url"></a> |
Relative or absolute URL to page, text between tags is link text |
| Set a location |
<a name="location"></a> |
|
| Link to location |
<a href="#location"></a> or <a href="page.html#location"></a> |
Within the same page/On a different page |
Formatting text
Description: XHTML text formatting elements
| Name |
Element |
Comments |
| Strong emphasis |
<strong></strong> |
Generally displayed as bold |
| Emphasis |
<em></em> |
Generally displayed as italic |
| Bigger text |
<big></big> |
Makes text one size bigger |
| Smaller text |
<small></small> |
Makes text one size smaller |
| Headings |
<h#></h#> |
Replace # with number 1-6 |
| Paragraph |
<p></p> |
|
| Line break |
<br /> |
|
Images
Description: XHTML image elements
| Name |
Element |
Comments |
| Image |
<img src="url" alt="???" /> |
Simple image tag. Alt is alternative text |
| Image with width and Height |
<img src="url" alt="???" width="#" height="#" /> |
Width and height in pixels |
Lists
Description: XHTML list elements
| Name |
Element |
Comments |
| Unordered list |
<ul></ul> |
Bullet point list |
| Ordered list |
<ol></ol> |
Numbered list |
| List item |
<li>Item text</li> |
Only allowed within list elements |
Forms
Description: XHTML form elements
| Name |
Element |
Comments |
| Form content |
<form action="url" method="post, get"></form> |
URL is CGI location or JavaScript, most forms use post |
| Form input |
<input type="text, password, checkbox, radio, image, hidden, submit, reset" /> |
|
| Input name |
<input name="value" /> |
Identifies the input field |
| Input value |
<input value="value" /> |
Default value, not required |
| Default selection |
<input checked="checked" /> |
Checkboxes and radio buttons only |
| Input size |
<input size="#" /> |
Size in characters, IE and NS differ in display |
| Maximum input length |
<input maxlength="#" /> |
In characters |
| Selection list |
<select name="value"></select> |
Items go in between tags |
| No. options shown |
<select size="#"></select> |
How many options shown at once |
| Multiple choices |
<select multiple="multiple"></select> |
Allows more than one choice |
| Select options |
<option value="value">Text</option> |
Displayed text inbetween tags. |
| Selected option |
<option selected="selected"></option> |
Default option |
| Option group |
<optgroup label="value"></optgroup> |
Groups options together |
| Multiple line text input |
<textarea name="value"></textarea> |
Text between tags is default text |
| Multi-line size |
<textarea rows="#" cols="#"></textarea> |
Rows in lines, cols in characters |
Tables
Description: XHTML table elements
| Name |
Element |
Comments |
| Table content |
<table></table> |
Cells and rows go between tags |
| Table row |
<tr></tr> |
Table cells go between row tags |
| Table cell |
<td></td> |
|
| Cell spanning 2+ column |
<td colspan="#"></td> |
Only required for more than one column |
| Cell spanning 2+ rows |
<td rowspan="#"></td> |
Only required for more than one row |
| Header cells |
<th align="left, right, center"></th> |
Content bold, align optional, default is center |
| Header spanning 2+ columns |
<th colspan="#"></th> |
As td colspan |
| Header spanning 2+ rows |
<th rowspan="#"></th> |
As td rowspan |
Miscellaneous
Description: XHTML miscellaneous elements
| Name |
Element |
Comments |
| Comments |
<!-- comments go here --> |
Not displayed in browsers |
| Style sheet |
<style type="text/css"></style> |
For Cascading Stylesheets |
| External style sheet |
<link rel="stylesheet" href="url" /> |
|
| Meta information tags |
<meta name="value" content="value" /> |
Hidden info within header |
| Horizontal rule |
<hr /> |
|