HTML Cheat Sheet

HTML documents have a tree structure, with each element parenthesized by a start tag <element> and an end tag </element>.

Heading Elements

The heading elements generally appear in the following order.
An HTML document.
The document heading.
The title should include the context of the document, such as the institution or author.
<link ...>
The relationship of this document to other documents. Examples include predecessor and subdocument. This is not yet defined.

Leading Body Elements

The leading body elements generally appear in this order.
The document body.
The level one heading corresponds to the title, but generally does not include the context. There should be only one level one heading.


A level n heading, n>1.
The paragraph separator. (It will become a start of paragraph in later versions.)
Preformatted text in fixed-width font.
Block quoted text.
An address.
line break
horizontal rule
<!-- text -->
Unformatted, undisplayed comments. Note, however, that readers may view the source and see the comments.


<ul> <li>text ... </ul>
Unordered list.
<ol> <li>text ... </ol>
Ordered list.
<dl> <dt>term text<dd>definition text ... </dl>
Definition list.

Semantic Fonts

Emphasized text.
Strongly emphasized text.
A word or text being defined.
Title text of books, films, etc.
Snippets of computer code text.
User keyboard entry text.
Computer status message text.
Metasyntactic variable text.

Presentation Fonts

Bold text.
Italic text.
Underlined text on some browsers.
Teletype text.
Blinking text on some browsers.

Character Entities

&lt; is <
&gt; is >
&amp; is &
&quot; is "
&nbsp; is a non-breaking space
&ouml; is ö (lowercase o with an umlaut)
&ntilde; is ñ (lowercase n with a tilde)
&Egrave; is È (uppercase E with a grave accent)
see also ISO Latin 1 Entities in HTML

Anchors and References

<a name="label">text</a>
An anchor definition for text.
<a href="URL">text</a>
An anchor reference where URL is the uniform resource locator and text is the reference text.
A Uniform Resource Locator where
is one of file:, ftp:, http:, gopher:, WAIS:, news:, or telnet:. The default is http:.
defaults to the host of the current document.
defaults to ?what?.
defaults to the current path.
defaults to the current file.
is one of
.txt, .html
static picture
.ps (Postscript) .gif, .tiff, .xbm (X bitmap), .jpg, .jpeg
motion picture
.mpg, .mpeg, .mov (Quicktime)
.aiff, .au
is a label reference within an HTML file. The default is the top of the file.
<img align=alignment src="URL.ext" alt="text">
An in-line image reference.
Chose top, middle, or omit for bottom.
Choose .gif or .xbm (X bitmap). For non-imaging browsers, text will be substituted for the image if present.

Author Identification

<hr> <address> <a href="">Lawrence A. Crowl</a>, <a href="/cgi-bin/mailform?"></a>, 5 April 1995 </address>

Trailing Elements

End of body.
End of HTML document.

Lawrence A. Crowl,, 7 September 1995