HTML Reference with Examples
This is a list of HTML (HyperText Markup Language) codes with
examples. It was originally written by Earle Goodman
(goodman@ucdavis.edu) who gathered information from a variety of
sources, but a lot came directly from the
HTML
Quick Reference. I updated it and added examples and cross
references.
There is an
HTML 4.01 Specification
at the
W3C Home Page.
I have a Table Sampler.
This page includes codes for
Specials Symbols,
Math,
Greek,
Business,
Foreign Letters.
-
<!-- text -->
- Comment text out of the HTML code. Note that there
must be a space after
<!-- and before
-->.
- <!--This--> will appear in some browsers, but
- <!-- This --> will not.
-
<a ATTRIBUTE> picture/text
</a>
- Adds an anchor to picture/text. Possible ATTRIBUTEs are:
-
href="#anchor_name"
- Link this to anchor_name within this document.
-
href="URL"
- Link this to URL.
-
href="URL#anchor_name"
- Link this to anchor_name within URL.
-
href="URL?search_string"
- Link this to search for search_string within URL.
-
METHODS
-
NAME="anchor_name"
- Make an anchor at this spot that is called anchor_name.
-
REL
-
REV
-
TITLE
-
URN
-
<address>address</address>
- Present address information. Causes a
line break. George Washington, Virginia
-
<base>
- Specify the name of file in which the current document is stored.
This is usually placed in the head of the document.
-
<blockquote> . . . </blockquote>
- Defines a section as being quoted from another source. For
instance,
No power or authority can
or ought to be maintained by virtue of [an office]
In my browser, it causes paragraph breaks.
-
<body> . . . </body>
- Defines the body of an HTML document.
-
<br>
- Force a line break, (use two for a blank line).
-
<cite> . . . </cite>
- Cite some material.
-
<code> . . . </code>
- Display this as HTML
code.
-
<dd>
definition </dd>
- Display a definition in a definition list or glossary. See
<dl> and
<dt>. (Commonly used
to make lists without bullets or numbers).
-
<dfn>definition</dfn>
- Display a definition.
-
<del>text</del>
- Indicate that
text is deleted, usually by a
"strike through" font.
Also see <ins>.
-
<div> . . . </div>
- Define this area as a division or block.
Also see <p>.
Example: there is a
centered division
embedded in this sentence.
-
<dl> . . . </dl>
- Make a definition list or glossary. See
<dt>,
<dd>,
<ol>, and
<ul>.
(Commonly used
to make lists without bullets or numbers). Example:
- This is item begins with <dt>. Later lines of
<dt>'s line up with this lefthand side.
- This item begins with <dd>. If the entry is too long, it
is indented on additional lines.
- This is the second <dd> item and is preceeded by a <p>.
<dd>'s should be enclosed by <p> </p>'s to
stand out.
- This is the third <dd> item. It is not preceeded by anything.
- This is the second <dt> item.
- <dt>'s should always be followed by at least one <dd>.
-
<dt> term
- Display a term in a definition list or glossary. See
<dl> and
<dd>.
-
<EM>text</EM>
- Emphasizes text. Also see
<STRONG>.
-
<FONT>
- Change font from here on. Some browsers support a
C
O
L
O
R
attribute. For more possibilities, see the
Color Samples Page.
-
<FORM ATTRIBUTE>
. . . </FORM>
- Define an online form. The information is sent to a query server
to search for or collect information for a database. Forms may
have
<INPUT> (for buttons or single lines
of text),
<SELECT> (for menus), or
<TEXTAREA> (for text rectangles) tags.
Possible ATTRIBUTEs are:
-
ACTION="URL"
- The URL of the query server.
-
METHOD=method
- The method should be post.
- For an example of handling POST data go to this
HTML tutorial
and click Forms, then <FORM ...>, then METHOD, then
POST which takes you to
METHOD
= POST
-
<H1>text</H1>
- Make text header style 1, the most prominent.
May have ALIGN attribute.
Example (align=center):
Header 1
-
<H2>text</H2>
- Make text header style 2. Example (align=right):
Header 2
-
<H3>text</H3>
- Make text header style 3. Example:
Header 3
-
<H4>text</H4>
- Make text header style 4. Example:
Header 4
-
<H5>text</H5>
- Make text header style 5. Example:
Header 5
-
<H6>text</H6>
- Make text header style 6, the least prominent.
Example:
Header 6
-
<HEAD> . . . </HEAD>
- Defines the head of an HTML document.
-
<HR>
- Place a horizontal rule, or separator between sections of
text. Example:
- Many browsers allow SIZE, ALIGN, and
WIDTH attributes. Example:
-
<HTML> . . . </HTML>
- Defines an HTML document.
-
<IMG ATTRIBUTE>
- Load an inline image (on browsers that support it). Possible
ATTRIBUTEs are:
-
ALIGN=alignment
- How to align the picture with the text, possible
alignments are top, middle, or bottom.
-
ALT="text"
- Alternative text that is displayed if browser
does not support images,
or image cannot be loaded.
-
BORDER=pixels
- Thickness of border in pixels. 0 for no border.
-
HEIGHT=pixels
- height of the image in pixels.
-
WIDTH=pixels
- width of the image in pixels. Height and width
allows the browser to display the page before the
image is downloaded.
- width of the image in pixels.
-
SRC="URL"
- The URL of the image.
-
<KBD>key</KBD>
- Display key as a key from the keyboard.
-
<ins>text</INS>
- Indicate that text is inserted, usually by an
underlined font.
Also see <del>.
-
<LI> item
- Display item in a list. See
<ol> and
<ul>.
-
<LINK ATTRIBUTE>
- Specify relationships to other documents.
This is usually placed in the head of the document. Possible
ATTRIBUTEs are:
-
REV=relationship
- The relationship of this file to the other one.
The relevant relationship is made.
-
href="URL"
- The URL of the file pointed to by the link.
-
<OL ATTRIBUTE> . . . </ol>
- Display an ordered list or glossary. (Headed by numbers.) See
<LI>,
<dl>, and
<ul>. Example:
- This item begins with <LI>. It is indented
and numbered. Wrapped lines are indented to
line up with the beginning.
- This is the second <LI> item.
- An ATTRIBUTE is:
-
start="number"
- The first number in the
list. Example:
- This the "fourth" item. (Where did item 3 go? I don't know.)
- This attribute is useful when you want to continue
numbering from a previous list.
-
<p> . . . </p>
- Define this area as a paragraph, and format accordingly.
Also see <div>.
-
<PRE> . . . </PRE>
- Define this area as preformatted text, and display as is. May
include some tags.
This may include links, for example, to STRONG
but it doesn't left justify
or fill and may handle tags
-
<STRONG>text</STRONG>
- Give strong emphasis to text. Also see
<EM>.
-
<SUB>text</SUB>
- Display text in subscript position. Example:
- xj < xj+1
-
<SUP>text</SUP>
- Display text in superscript position. Example:
- A quadratic equation is ax2 + bx + c
- There are special sequences for superscript 2 and 3, which
are easier to render and look better. Example:
- The answer is zy³ + ax² + bx + c
-
<TABLE>, <TD>,
<TH>, and <TR>
- Find out about tables by looking at these
examples of tables.
-
<TITLE>title</TITLE>
- Define the title of the document. Note this is not
a header. This is usually placed in the head
of the document.
-
<TT>text</TT>
- Display text in a typewriter font.
-
<ul> . . . </ul>
- Display an unordered list or glossary. Usually headed by bullets. See
<LI>,
<dl>, and
<ol>. Example:
- This item begins with <LI>. It is indented
and begins with a "bullet." As you can see, wrapped
lines are indented.
- This is the second <LI> item.
Codes for Special Characters
-
&
- ampersand (&)
-
>
- greater than (>)
-
<
- less than (<)
-
"
- double quote (")
-
- non-breaking space ( ). A bunch of these (->
<-) aren't displayed as one
space like spaces (-> <-) are.
-
&#ascii;
- ASCII character for decimal ascii. There is also a
list of all characters from 161 to 255.
¿
- inverted question mark (¿)
¡
- inverted exclamation mark (¡)
§
- section (§)
¶
- paragraph (¶)
•
- bullet (•)
The following don't show up in some fonts.
†
- dagger (†)
‡
- double dagger (‡)
—
- em-dash (—)
‹
- left ? (‹) instead of <
›
- right ? (›) instead of >
«
- left ? («)
»
- right ? (»)
'
- apostrophe (') instead of '
‘
- left single quote (‘) instead of '
’
- right single quote (’)
“
- left double quote (“) instead of "
”
- right double quote (”)
Codes for Math
²
- superscript 2 (x²)
³
- superscript 3 (x³)
∫
- integral (∫)
∑
- summation (∑)
∏
- product (∏)
√
- square root (√)
−
- minus (−) instead of -
±
- plus/minus (±)
∞
- infinity (∞)
≈
- approximately equal (≈)
∝
- proportional (∝)
≡
- equivalent (≡)
≠
- not equal (≠)
≤
- less than or equal (≤)
≥
- greater than or eqal (≥)
×
- times (×) instead of x.
·
- dot (·)
÷
- divide (÷)
∂
- partial derivative (∂)
′
- prime (′) instead of '
″
- double prime (″) instead of "
∇
- nabla (∇)
‰
- per mil (‰)
°
- degree (°)
∴
- therefore (∴)
ø
- empty set (ø)
∈
- member (∈)
∉
- not in (∉)
∩
- cap (∩)
∪
- cup (∪)
⊂
- proper subset (⊂)
⊃
- proper superset (⊃)
⊆
- subset (⊆)
⊇
- superset (⊇)
¬
- not (¬)
∧
- and (∧)
∨
- or (∨) instead of V
∃
- there exists (∃)
∀
- for all (∀)
→
- right arrow (→)
←
- left arrow (←)
↔
- arrow (↔)
⇒
- right double arrow (⇒)
⇐
- left double arrow (⇐)
⇔
- double arrow (⇔)
Codes for Greek (and Hebrew Aleph)
ℵ
- Hebrew aleph (ℵ)
-
α
- alpha (α)
β
- beta (β)
γ
- gamma (γ)
Γ
- Gamma (Γ)
δ
- delta (δ)
Δ
- Delta (Δ)
ε
- epsilon (ε)
ζ
- zeta; (ζ )
η
- eta (η)
θ
- theta (θ)
Θ
- Theta (Θ)
ι
- iota (ι)
κ
- kappa (κ)
λ
- lambda (λ)
Λ
- Lambda (Λ)
μ or µ
- mu (μ or µ)
ν
- nu (ν)
ξ
- xi (ξ)
Ξ
- Xi (Ξ)
ο
- omicron (ο)
π
- pi (π)
Π
- Pi (Π)
ρ
- rho (ρ)
σ
- sigma (σ)
Σ
- Sigma (Σ)
ς
- sigmaf (ς)
τ
- tau (τ)
υ
- upsilon (υ)
φ
- phi (φ)
Φ
- Phi (Φ)
χ
- chi (χ)
ψ
- psi (ψ)
Ψ
- Psi (Ψ)
ω
- omega (ω)
Ω
- Omega (Ω)
Codes for Business
-
¢
- Cent (¢)
€
- Euro (€)
-
£
- Pound sterling (£)
-
¥
- Yen (¥)
¤
- currency (¤)
-
©
- copyright mark (©)
-
®
- registered trademark (®)
™
- trademark (™)
Codes for Letters from other Languages
-
Á
- capital A, acute accent (Á)
-
á
- small a, acute accent (á)
-
Â
- capital A, circumflex accent (Â)
-
â
- small a, circumflex accent (â)
-
Æ
- capital AE diphthong (ligature) (Æ)
-
æ
- small ae diphthong (ligature) (æ)
-
À
- capital A, grave accent (À)
-
à
- small a, grave accent (à)
-
Å
- capital A, ring (Å)
-
å
- small a, ring (å)
-
Ã
- capital A, tilde (Ã)
-
ã
- small a, tilde (ã)
-
Ä
- capital A, dieresis or umlaut mark (Ä)
-
ä
- small a, dieresis or umlaut mark (ä)
-
Ç
- capital C, cedilla (Ç)
-
ç
- capital c, cedilla (ç)
-
É
- capital E, acute accent (É)
-
é
- small e, acute accent (é)
-
Ê
- capital E, circumflex accent (Ê)
-
ê
- small e, circumflex accent (ê)
-
È
- capital E, grave accent (È)
-
è
- small e, grave accent (è)
-
Ë
- capital E, dieresis or umlaut mark (Ë)
-
ë
- small e, dieresis or umlaut mark (ë)
-
Ð
- capital Eth, Icelandic (Ð)
-
ð
- small eth, Icelandic (ð)
-
Í
- capital I, acute accent (Í)
-
í
- small i, acute accent (í)
-
Î
- capital I, circumflex accent (Î)
-
î
- small i, circumflex accent (î)
-
Ì
- capital I, grave accent (Ì)
-
ì
- small i, grave accent (ì)
-
Ï
- capital I, dieresis or umlaut mark (Ï)
-
ï
- small i, dieresis or umlaut mark (ï)
-
Ñ
- capital N, tilde (Ñ)
-
ñ
- small n, tilde (ñ)
-
Ó
- capital O, acute accent (Ó)
-
ó
- small o, acute accent (ó)
-
Ô
- capital O, circumflex accent (Ô)
-
ô
- small o, circumflex accent (ô)
-
Ò
- capital O, grave accent (Ò)
-
ò
- small o, grave accent (ò)
-
Ø
- capital O, slash (Ø)
-
ø
- small o, slash (ø)
-
Õ
- capital O, tilde (Õ)
-
õ
- small o, tilde (õ)
-
Ö
- capital O, dieresis or umlaut mark (Ö)
-
ö
- small o, dieresis or umlaut mark (ö)
-
ß
- small sharp s, German (sz ligature) (ß)
-
Þ
- capital THORN, Icelandic (Þ)
-
þ
- small thorn, Icelandic (þ)
-
Ú
- capital U, acute accent (Ú)
-
ú
- small u, acute accent (ú)
-
Û
- capital U, circumflex accent (Û)
-
û
- small u, circumflex accent (û)
-
Ù
- capital U, grave accent (Ù)
-
ù
- small u, grave accent (ù)
-
Ü
- capital U, dieresis or umlaut mark (Ü)
-
ü
- small u, dieresis or umlaut mark (ü)
-
Ý
- capital Y, acute accent (Ý)
-
ý
- small y, acute accent (ý)
-
ÿ
- small y, dieresis or umlaut mark (ÿ)
Karen M. Strom made a set of gifs of
Greek Letters and Math Symbols in case your browser doesn't
support the fanicer set.
Find out about forms at
Decoding
forms with CGI.
Updated
Mon Mar 24 15:43:39 2008
by Paul E. Black
(paul.black@nist.gov)