Simon's HTML 3.2 Test & Example Page

This page describes and shows by example most HTML 3.2 constructs. View the source of this page to see the exact use of tags, and attributes. To use this page both view it and print it. Compare the results viewed on and printed from different browsers.  
Hyper Text Markup Language (HTML) is a the publishing language of the World Wide Web. It supports text, multimedia, and hyperlinks. It provides a means of describing the layout, content, and structure of documents. An HTML document, such as this one, is displayed by a Browser.
Uniform Resource Identifiers (URI) provide a unique address for every resource on the Web.
HTML consists of a number of elements, generally with three parts, a start tag, content, and an end tag. Tags are bracketted, an element looks like <element-name> content </element-name>. In some cases content and end tag are optional. Elements may have attributes. Attributes may have assigned values. Attributes alter the behaviour of the element.
A simple HTML document has the following structure
<html>
  <!-- Comment -->
<head>
  <title>Example of a Simple HTML Page</title>
</head>
<body bgcolor="yellow">
  <h1>Example of a Simple HTML Page</h1>
  Click on the <href="html-test-page.html">hyperlink</a>.
  <br>
  View the image. <img src="ball.gif" height=50 width=50 border=0>
</body>
</html>
A frame HTML document has the following structure
<html>
<head>
  <title>Example of a Frame HTML page</title>
</head>
<frameset rows=20%,*>
  <frame src="example-simple.html">
  <frame src="html-test-page.html">
</frameset>
<noframes>
This page requires a Frame capable browser.
</noframes>
</html>
 

Structural Definitions

These tags imply some meaning and structure to the document. The appearance they are given is controlled by the browser and its preferences.

TAG Name Attributes Example
H1 Heading 1 ALIGN = {left center right}

Heading 1

H2 Heading 2 ALIGN = {left center right}

Heading 2

H3 Heading 3 ALIGN = {left center right}

Heading 3

H4 Heading 4 ALIGN = {left center right}

Heading 4

H5 Heading 5 ALIGN = {left center right}
Heading 5
H6 Heading 6 ALIGN = {left center right}
Heading 6
 
Heading Examples
Heading 6 Align = Left
Heading 6 Align = Center
Heading 6 Align = Right
DIV Division ALIGN = {left center right}
CLASS = "meaning"
Division align = center

TAG Name Example
CITE Citation Arthur C Clarke, Against The Fall of Night, 1953.
EM Emphasis Emphasis
STRONG Strong Emphasis Strong Emphasis
CODE Code Code
SAMP Sample Output Sample Output
KBD Keyboard Keyboard
VAR Variable Variable
DFN Definition Definition
ADDRESS Author's Address
Author's Address

Presentation Formatting

These tags allow the document's author to control the appearance of the document.

TAG Name Example
B Bold Bold
I Italic Italic
S
STRIKE
Strikeout Strikeout
Strikeout
SUB Subscript Subscript
SUP Superscript Superscript
TT Typewriter Typewriter
BIG Large Font Size Large Font Size
SMALL Small Font Size Small Font Size
CENTER Center
Centred text. Use the DIV tag in preference.
BLINK Blink To Blink or not to Blink . Not, I think.
U Underline Underline
<!-- Comment Tag encapsulates all text until -->. Can be used to comment out other tags. Can be nested.
WBR Word Break Word Break exhibit
NOBR No Break If this line disappears off the right hand side of the page, window, or frame, you are seeing this tag in action.

Block elements

These tags cause paragraph breaks.

TAG Name Attributes Example
BLOCKQUOTE Block Quote ALIGN = {left center right justify} Science Fiction has some memorable prose
In this Universe the night was falling: the shadows were lengthening toward an east that would not know another dawn. But elsewhere the stars were still young and the light of morning lingered: and along the path he had once followed, Man would one day go again.
as exemplified in the justified quote above.
PRE Preformatted WIDTH = #
 Preformatted text with line
              breaks, and a maximum line width of 30 characters.
        
P Paragraph ALIGN = {left center right justify} Paragraph one.

Paragraph two. This paragraph has alignment set to "justify". Not all browsers support justified alignment.

After closing tag. Closing tag is optional.
BR Line Break CLEAR = {left right all} Line
break
exhibit. CLEAR moves vertically down until left, right, or all margins are clear of images.
HR Horizontal Rule ALIGN = {left right center}
NOSHADE
SIZE = #
WIDTH = {% #}
Horizontal
rule. No end tag.
Size = 10

No shade

Width = 50%

Width = 100
MULTICOL Multiple Columns COLS = # GUTTER = # WIDTH = # % Multicol is a Netscape enhancement. MULTICOL can be nested. COLS specifies the number of columns to be used. The GUTTER attribute specifies the space to be left between the columns in pixels. Width specifies in pixels or as a percentage the amount of the window to use. This text is formatted with COLS = 2. Actually it looks very good.
SPACER Spacing TYPE = {block horizontal vertical}
HEIGHT = n
WIDTH = n
SIZE = n
This text is preceeded by a block spacer of height 30 and width 60, similar to an image of the same size. This text is preceeded by a horizontal spacer of size 30, similar to a tab. This text is preceeded by a vertical spacer of size 30, similar to a vertical tab, but note the line break.

Lists

 
 
Lists provide a means of tabulating data. They provide structure to a document. Formatting is controlled by the browser, paragraph breaks are implied by the tags. Lists can be nested.

TAG Name Attributes Example Compact Example
UL
LI
Unordered List
List item
COMPACT
TYPE =
{disk circle square}
    Unordered list
  • Unordered list item
  • Second unordered list item, Bullet type default
  • Bullet Type = Disc
  • Bullet Type = Circle
  • Bullet Type = Square
  • Last unordered list item
    Unordered compact list
  • Unordered list item
  • Second unordered list item
  • Last unordered list item
OL
LI
Ordered List
List item
COMPACT
START = #
TYPE = {A a I i 1}
VALUE = #
    Ordered list
  1. Ordered list item
  2. Second ordered list item
  3. Ordinal Type = A
  4. Ordinal Type = a
  5. Ordinal Type = I
  6. Ordinal Type = i
  7. Ordinal Type = 1
  8. Value = 10
  9. Last ordered list item
    Ordered compact list Start = 4
  1. Ordered list item
  2. Second ordered list item
  3. Last ordered list item
MENU
LI
Menu List
List item
COMPACT Menu list
  • Menu list item
  • Second menu list item
  • Last menu list item
  • Menu compact list
  • Menu list item
  • Second menu list item
  • Last menu list tem
  • DIR
    LI
    Directory List
    List item
    COMPACT Directory list
  • Directory list item
  • Second directory list item
  • Last directory list item
  • Directory compact list
  • Directory list item
  • Second directory list item
  • Last directory list item
  • DL
    DT
    DD
    Definition List
    Term
    Definition
    COMPACT
    Definition list
    Term to be defined
    Definition of term
    Last term to be defined
    Last definition of term
    Definition compact list
    Term to be defined
    Definition of term
    Last term to be defined
    Last definition of term

    HTML Document

    TAG Name Attributes Example
    !DOCTYPE Document Type HTML PUBLIC "-//W3C//DTD HTML 3.2 Final//EN No closing tag.
    HTML Hyper Text
    Markup Language
    A plain text file structured with tags. Tags are signified by a left and right angle bracket. <tag>. HTML is not case sensitive, although attribute values, escape sequences, and URIs may be.
    Encapsulates document.
    HEAD Document Head
     
    Encapsulates Head Elements
    TITLE Document Title
     
    Title is text enclosed by tags. Used as Window Title.
    ISINDEX Query PROMPT = String Query String sent to server. No closing tag.
    BASE Base URI HREF = "URI"
    TARGET = {"windowname" _blank _self _parent _top}
    Base URI for dereferencing relative URIS. Document URI is used by default. No closing tag.
    META Meta Information NAME = "property"
    CONTENT = "property value".
    NAME = "robots"
    CONTENT = "noindex, nofollow"
    HTTP-EQUIV = "Expires"
    CONTENT = "dd-mon-yyyy hh:mm:ss TZ"
    HTTP-EQUIV = "Refresh"
    CONTENT = "seconds; URI = URI"
    describing document properties. No closing tag. Arbitrary user specified NAME meta information could be ROBOTS, AUTHOR, KEYWORDS, DESCRIPTION, GENERATOR, and CONTENT-TYPE.
    LINK Relationships REL = "forward relationship"
    REV = "reverse relationship"
    HREF = "URI"
    Defines relationships with other documents and resources Relationships are {top contents index glossary copyright next previous help search}. No closing tag.
    BODY Document
    Body
    BGCOLOR = "colour"
    TEXT = "colour"
    LINK = "colour"
    VLINK = "colour"
    ALINK = "colour"
    BACKGROUND = "URI"
    BGPROPERTIES = "FIXED"
    Encapsulates Body Elements
    A Anchor NAME = "name"
    HREF = "URI"
    REL = "relationship"
    REV = "relationship"
    TITLE = "title"
    TARGET = {"windowname" _blank _self _parent _top}
    Define hypertext links and named locations for use as targets. Can't be nested. URI example "mailto:name@domain?subject=text&body=moretext" or "http://domain".
    IMG Inline Image SRC = "URI"
    ALT = "description"
    ALIGN = {top middle bottom left right absmiddle absbottom texttop baseline}
    WIDTH = #
    HEIGHT = #
    BORDER = #
    HSPACE = #
    VSPACE = #
    ISMAP
    USEMAP = "mapname"
    Align Top Align Middle
    Align Bottom Align TextTop
    Align Left Align Right
    Align AbsMiddle Align AbsBottom
    Align Baseline Default
    MAP
    AREA
    Client Side Image Map NAME = "mapname"
    SHAPE = {rect polygon circle}
    COORDS = {"x1, y1, x2, y2" "x1 y1 r" "x1, y1, ... xn, yn"}
    HREF = "URI"
     
    EMBED Embed arbitrary data object. SRC = "URI"
    WIDTH = #
    HEIGHT = #
    ALIGN = {left center right}
    HIDDEN
    HSPACE = #
    VSPACE = #
    TYPE = "mimetype"
    ALT = "text"
    No closing tag.
    NOEMBED HTML for Non EMBED enabled browsers The NOEMBED tag must immediately follow the EMBED tag. This browser does not understand the EMBED tag.
    BASEFONT Base Font SIZE = "size" Size from 1 to 7. Should be at beginning of document.
    FONT Font SIZE = "size"
    COLOR = "colour"
    FACE = "font names list in order of preference"
    Size from 1 to 7, or relative, eg +1, -2. Face is not part of HTML 3.2
     
    1Aa# 2Aa# 3Aa# 4Aa# 5Aa# 6Aa# 7Aa#

    Tables

    Tables provide a means of organising data and controlling layout. They provide structure to a document. Formatting is controlled by the browser, paragraph breaks are implied by the tags. Tables can be nested.

    TAG Name Attributes Example
    TABLE Table ALIGN = {left right center}
    WIDTH = {# %}
    BORDER = #
    CELLSPACING = #
    CELLPADDING = #
    BGCOLOR = colour
    COLS = #
    BACKGROUND = "URI"
    BORDERCOLOR = colour
    Aligns table on page, width as specified, Border 0 or more, Cellspacing 0 or more, Cellpadding 0 or more
    CAPTION Caption ALIGN = {top bottom} Placement of caption at top or bottom of table
    TR Table Row ALIGN = {left center right}
    VALIGN = {top middle bottom baseline}
    BGCOLOR = colour
    BACKGROUND = "URI"
    Closing tag is optional.
    TH Table Header ALIGN = {left center right}
    VALIGN = {top middle bottom baseline}
    ROWSPAN = #
    COLSPAN = #
    NOWRAP
    WIDTH = #
    HEIGHT = #
    BGCOLOR = colour
    BACKGROUND = "URI"
    Table Header cell. End tags are optional. Lines in cell cannot be broken.
    TD Table Data ALIGN = {left center right}
    VALIGN = {top middle bottom baseline}
    ROWSPAN = #
    COLSPAN = #
    NOWRAP
    WIDTH = #
    HEIGHT = #
    BGCOLOR = colour
    BACKGROUND = "URI"
    Table Data cell. End tags are optional. NOWRAP prevents linebreaking.

    Table Examples

    Borders are drawn around individual cells only if they have content. To force content use <PRE> </PRE>, later browsers recognise &nbsp; as content. The table below has default settings for all TABLE attributes except that BORDER is specified and BACKGROUND=dots.gif. BORDERCOLOR is blue.

    Caption Align = bottom
    Table Header
    Table Data
    Cell with content to right
     
    Blank cell on right
    Column span = 2
    Row span = 3 Cell Width = 200
    Cell Height = 45
    Cell Background = scalelight.gif
    Align = right
    Row BGColor = gold Height = 45 Cell Align = center
    Cell BGColor = silver Cell BGColor = steelblue
    Row Background = scaledark.gif  
    Printing white text with a black background can be a problem.

    Table with border = 15 and cell spacing = 15

    Table with border = 15 and cell padding = 15

    Alignment Default Baseline Top Center Bottom
    Default Rows show ALIGN,
    Columns show VALIGN
    Rows show ALIGN,
    Columns show VALIGN
    Rows show ALIGN,
    Columns show VALIGN
    Rows show ALIGN,
    Columns show VALIGN
    Rows show ALIGN,
    Columns show VALIGN
    Left Rows show ALIGN,
    Columns show VALIGN
    Rows show ALIGN,
    Columns show VALIGN
    Rows show ALIGN,
    Columns show VALIGN
    Rows show ALIGN,
    Columns show VALIGN
    Rows show ALIGN,
    Columns show VALIGN
    Center Rows show ALIGN,
    Columns show VALIGN
    Rows show ALIGN,
    Columns show VALIGN
    Rows show ALIGN,
    Columns show VALIGN
    Rows show ALIGN,
    Columns show VALIGN
    Rows show ALIGN,
    Columns show VALIGN
    Right Rows show ALIGN,
    Columns show VALIGN
    Rows show ALIGN,
    Columns show VALIGN
    Rows show ALIGN,
    Columns show VALIGN
    Rows show ALIGN,
    Columns show VALIGN
    Rows show ALIGN,
    Columns show VALIGN

    Forms


    TAG Name Attributes Example
    FORM Fill Out Forms ACTION = "URI"
    METHOD = {get post}
    ENCTYPE = string
    TARGET = {"windowname" _blank _self _parent _top}
     
    INPUT TYPE = button NAME = string
    VALUE = string
    onClick = js

    Jump using button
    INPUT TYPE = checkbox NAME = string
    VALUE = string
    CHECKED
    Your pages are great
    Show me the door
    Checkboxes cannot be grouped by using the same NAME.
    INPUT TYPE = radio NAME = string
    VALUE = string
    CHECKED
    No Value First
    Second
    Third
    Choose
    Only
    One
    Radio buttons can be grouped in a set by using the same NAME.
    INPUT TYPE = image NAME = string
    SRC = "URI"
    ALIGN = {left right top middle bottom}
    SELECT Select items from menu NAME = string
    SIZE = #
    MULTIPLE
    Select multiple items from a list where 4 items are visible
    OPTION define menu items SELECTED VALUE = string
     
    Select one item from a list where 1 item is visible
    INPUT TYPE=text SIZE = #
    VALUE = string
    MAXLENGTH = #
    NAME = string
    TEXTAREA Multiline text field NAME = string
    ROWS = #
    COLS = #
    WRAP = {off virtual physical}
    INPUT TYPE = password SIZE = #
    MAXLENGTH = #
    INPUT TYPE = file NAME = string
    SIZE = #
    MAXLENGTH = #
    ACCEPT = "string"
    INPUT TYPE = hidden NAME = string
    VALUE = string
    INPUT TYPE = reset VALUE = string
    INPUT TYPE = submit NAME = string
    VALUE = string

    Frames

    Frames provide a mechanism to show a number of panes as rows and columns within the browser window. Frames can be nested.

    TAG Name Attributes Example
    FRAMESET Frameset ROWS = {# % * #*}{, # % * #* ...}
    COLS = {# % * #*}{, # % * #* ...}
    BORDER = #
    FRAMEBORDER = {yes no}
    BORDERCOLOR = colour
    Used instead of <BODY>. Example coming soon, well one day. Reference.
    FRAME Frame SRC = "URI"
    NAME = {"windowname" _blank _self _parent _top}
    MARGINWIDTH = #
    MARGINHEIGHT = #
    SCROLLING = {yes no auto}
    NORESIZE
    FRAMEBORDER = {yes no}
    BORDERCOLOR = colour
    Example coming sooner or later.
    _blank : load in new blank unnamed window.
    _self : load in same window.
    _parent : load in immediate FRAMESET parent.
    _top : load in full body of window.
    NOFRAMES No Frames
     
    For non frames browsers

    Character Sets

    Characters and special symbols can be inserted in text and HTML, either as a numeric character reference (&#nnnn; where nnnn is a number corresponding to a character in a character set), or as a named entity reference (&#mnem; where mnem is the mnemonic for the character). These are described in a number of places, and a include only a few of the more common and useful ones.
    There are also some circumstances, particularly in URIs where you can use %##, eg %20 for space, to represent characters that otherwise wouldn't be parsed by the browser.
    %20space   %21!   %22 %23#   %24$   %25%   %26&   %27'   %28(   %29)   %2a*   %2b+   %2c,   %2d-   %2e.   %2f/   %3a:   %3b;   %3c<   %3d=   %3e>   %3f?   %40@  

    Chr Name # Description Chr Name # Description Chr Name # Description
      &#09; Horizontal Tab     &#32; Space !!   &#33; Exclamation Mark
    """ &quot; &#34; Double quotation mark &&& &amp; &#38; Ampersand . .   &#46; Full stop (period)
     << &lt; &#60; Less than  >> &gt; &#62; Greater than @ @   &#64; Commercial at
        &nbsp; &#160; Non breaking space  ¡¡ &iexcl; &#161; Inverted exclamation  ¢¢ &cent; &#162; Cent
     ££ &pound; &#163; Pound sign  ¤¤ &curren; &#164; Currency sign  ¥¥ &yen; &#165; Yen sign
     ¦¦ &brvbar; &#166; Broken Vertical Bar  §§ &sect; &#167; Section sign  ©© &copy; &#169; Copyright
     «« &laquo; &#171; Left angle quote, guillemot left  ¬¬ &not; &#172; Not  ®® &reg; &#174; Registered sign
     ±± &plusmn; &#177; Plus minus sign   &para; &#182; Paragraph sign  »» &raquo; &#187; Right angle quote, guillemot right
     ¼¼ &frac14; &#188; One quarter fraction  ½½ &frac12; &#189; One half fraction  ¾¾ &frac34; &#190; Three quarters fraction
     ¿¿ &iquest; &#191; Inverted question mark  ×× &times; &#215; Times  ÷÷ &divide; &#247; Division sign
      &bull; &#8226; bullet   &hellip; &#8230; horizontal ellipsis   &prime; &#8242; prime = minutes = feet
     &Primt; &Prime; &#8243; double prime = seconds = inches   &oline; &#8254; overline   &frasl; &#8260; fraction slash
      &larr; &#8592; leftwards arrow   &uarr; &#8593; upwards arrow   &rarr; &#8594; right arrow
      &darr; &#8595; downwards arrow   &harr; &#8596; left right arrow   &crarr; &#8629; downwards arrow with corner leftwards

    Key

    Bold HTML 3.2
    % Percentage, used for WIDTH attribute, % width of frame, % width of table
    # Number. Pixels, used for WIDTH, HEIGHT, BORDER, HSPACE, VSPACE, CELLSPACING, CELLPADDING attributes. WIDTH and HEIGHT of image. SIZE of horizonal line. Characters for SELECT, INPUT. Count for START. ROWSPAN, COLSPAN.
    { } List of values from which one at a time can be used.