This is a paragraph.
Some elements appear as just a start tag. For example, to create a
line break, you use This is a paragraph.
Every HTML document as a minimum must have a title. To identify the
document as being HTML 3.0, it is recommended that documents start
with the prologue:
When absent, this prologue is implied by the MIME content type for
HTML 3.0 together with the associated version parameter.
------------------------------------------------------------------------------
Document Structure
HTML 3.0 documents formally have the following structure:
defines a paragraph that acts as a couplet in a stanza. By
convention, the class names are interpreted hierarchically, with
the most general class on the left and the most specific on the
right, where classes are separated by a period. The CLASS
attribute is most commonly used to attach a different style to
some element, but it is recommended that where practical class
names should be picked on the basis of the element's semantics,
as this will permit other uses, such as restricting search
through documents by matching on element class names. The
conventions for choosing class names are outside the scope of
this specification.
BACKGROUND
This can be used to specify a URI for an image tile to cover the
document background. This provides a way of giving a group of
documents a distinctive appearence. Clients may ignore this
attribute. It is included here for the benefit of clients that
don't support style sheets. Note that the text color may need to
be adjusted to show an adequate contrast with the background.
Dave Raggett Page 24
HTML 3.0 28th March 1995
Note that you don't need to include a BODY tag unless you want to
specify one of the above attributes.
Body Structure
The document body is composed from zero or more of the following
elements:
* DIV - used for hierarchical containers and static banners
* Headings (H1, to H6) - a set of headers of varying levels of
importance
* Block elements - paragraphs, lists, forms, tables, figures and
other elements
* Horizontal rules, and the ADDRESS element
* Text and character level markup including emphasis, images,
math, hypertext links and miscellaneous elements.
Note that text and character level markup are only permitted at this
level for backwards compatibility with legacy documents. The
HTML.Recommended flag enforces a more structured approach to
authoring HTML documents.
Dave Raggett Page 25
HTML 3.0 28th March 1995
Banners
Permitted Context: the start of the BODY element
Content Model: %Body.Content
The BANNER element is used for corporate logos, navigation aids,
disclaimers and other information which shouldn't be scrolled with
the rest of the document. It provides an alternative to using the
LINKelement in the document head to reference an externally defined
banner.
Permitted Attributes
ID
An SGML identifier used as the target for hypertext links or for
naming particular elements in associated style sheets.
Identifiers are NAME tokens and must be unique within the scope
of the current document.
LANG
This is one of the ISO standard language abbreviations, e.g.
"en.uk" for the variation of English spoken in the United
Kingdom. It can be used by parsers to select language specific
choices for quotation marks, ligatures and hypenation rules etc.
The language attribute is composed from the two letter language
code from ISO 639, optionally followed by a period and a two
letter country code from ISO 3166.
CLASS
This a space separated list of SGML NAME tokens and is used to
subclass tag names. By convention, the class names are
interpreted hierarchically, with the most general class on the
left and the most specific on the right, where classes are
separated by a period. The CLASS attribute is most commonly used
to attach a different style to some element, but it is
recommended that where practical class names should be picked on
the basis of the element's semantics, as this will permit other
uses, such as restricting search through documents by matching
on element class names. The conventions for choosing class names
are outside the scope of this specification.
Dave Raggett Page 26
HTML 3.0 28th March 1995
Divisions
Permitted Context: %Body.Content
Content Model: %Body.Content
The DIV element is used with the CLASS attribute to represent
different kinds of containers, e.g. chapter, section, abstract, or
appendix. For example:
TheChieftain product range is the white hot hope for the
coming year. This report sets out how to position Chieftain
against competing products.
element is used to define a paragraph. The exact rendering
(indentation, leading etc.) is not defined and may be a function of
other tags, style sheets, etc. The ALIGN attribute can be used to
explicitly specify the horizontal alignment. Paragraph elements have
the same content model as headers, that is text and character level
markup, such as character emphasis, inline images, form fields and
math.
Example:
Here is the text of the first paragraph. and this is
the text of the second paragraph.
The text up to the next element is treated as being part of the
current paragraph. This is an example of how SGML allows certain end
tags like defines a
paragraph that acts as an abstract. By convention, the class
names are interpreted hierarchically, with the most general
class on the left and the most specific on the right, where
classes are separated by a period. The CLASS attribute is most
commonly used to attach a different style to some element, but
it is recommended that where practical class names should be
picked on the basis of the element's semantics, as this will
permit other uses, such as restricting search through documents
by matching on element class names. The conventions for choosing
class names are outside the scope of this specification.
ALIGN
Paragraphs are usually rendered flush left. The ALIGN attribute
can be used to explicitly specify the horizontal alignment:
align=left
The paragraph is rendered flush left (the default).
align=center
The paragraph is centered.
align=right
The paragraph is rendered flush right.
align=justify
Text lines are justified where practical, otherwise this
gives the same effect as the default align=left setting.
For example:
This is a centered paragraph.
and this is a flush right paragraph.
CLEAR
This attribute is common to all block-like elements. When text
flows around a figure or table in the margin, you sometimes want
to start an element like a header, paragraph or list below the
figure rather than alongside it. The CLEAR attribute allows you
to move down unconditionally:
Dave Raggett Page 34
HTML 3.0 28th March 1995
clear=left
move down until left margin is clear
clear=right
move down until right margin is clear
clear=all
move down until both margins are clear
Alternatively, you can decide to place the element alongside the
figure just so long as there is enough room. The minimum width
needed is specified as:
clear="40 en"
move down until there is at least 40 en units free
clear="100 pixels"
move down until there is at least 100 pixels free
The style sheet (or browser defaults) may provide default
minimum widths for each class of block-like elements.
NOWRAP
The NOWRAP attribute is used when you don't want the browser to
automatically wrap lines. You can then explicitly specify line
breaks in paragraphs using the BR element. For example:
This paragraph has wordwrap turned off noct The Potomac river flows into Boston harbour,
and played an important role in opening up the hinterland
to early settlers...
Elsewhere, you can define a link to this paragraph, as follows:
Boston is a historic city and
a thriving center of commerce and higher education.
The reader can select the link labelled "Boston" to see further
information on the Boston area.
LANG
Dave Raggett Page 40
HTML 3.0 28th March 1995
This is one of the ISO standard language abbreviations, e.g.
"en.uk" for the variation of English spoken in the United
Kingdom. It can be used by parsers to select language specific
choices for quotation marks, ligatures and hypenation rules etc.
The language attribute is composed from the two letter language
code from ISO 639, optionally followed by a period and a two
letter country code from ISO 3166.
CLASS
This a space separated list of SGML NAME tokens and is used to
subclass tag names. By convention, the class names are
interpreted hierarchically, with the most general class on the
left and the most specific on the right, where classes are
separated by a period. The CLASS attribute is most commonly used
to attach a different style to some element, but it is
recommended that where practical class names should be picked on
the basis of the element's semantics, as this will permit other
uses, such as restricting search through documents by matching
on element class names. The conventions for choosing class names
are outside the scope of this specification.
HREF
The HREF attribute implies that the anchor acts as the start of
a hypertext link. The destination is designated by the value of
the HREF attribute, which is expressed in the Universal Resource
Identifier (URI) notation.
MD
Specifies a message digest or cryptographic checksum for the
linked document designated by the HREF attribute. It is used
when you want to be sure that a linked object is indeed the same
one that the author intended, and hasn't been modified in any
way. For instance, MD="md5:jV2OfH+nnXHU8bnkPAad/mSQlTDZ", which
specifies an MD5 checksum encoded as a base64 character string.
The MD attribute is generally allowed for all elements which
support URI based links.
NAME
This attribute is used to define a named anchor for use as the
destination of hypertext links. For example, the following
defines an anchor than can be used as the destination of a jump
into a description of the Boston area.
The flows into Boston
harbour.
Note: the NAME attribute has been superceded by the ID
attribute. User agents should include support for NAME to ensure
backwards compatibility with legacy documents produced using
previous versions of HTML.
SHAPE
This attribute is used within figures to define shaped hotzones
Dave Raggett Page 41
HTML 3.0 28th March 1995
for graphical hypertext links. Full details of how to use this
feature will be given with the description of the figure
element. The attribute value is a string taking one of the
following forms:
"default"
Used to define a default link for the figure background.
"circle x, y, r"
Where x and y define the center and r specifies the radius.
"rect x, y, w, h"
Where x, y define the upper left corner and w, h define the
width and height respectively
"polygon x1, y1, x2, y2, ..."
Given n pairs of x, y coordinates, the polygon is closed by
a line linking the n'th point to the first. Intersecting
polygons use the non-zero winding number rule to determine
if a point lies inside the polygon.
If a pointer event occurs in a region where two or more shapes
overlap, the distance from the point to the center of gravity of
each of the overlapping shapes is computed and the closest one
chosen. This feature is useful when you want lots of closely
spaced hotzones, for example over points on a map, as it allows
you to use simple shapes without worrying about overlaps.
Note: The x coordinate increases to the right, and the y
coordinate increases downwards in the same way as IMG and image
maps. If both numbers are integers, the coordinates are
interpreted as pixel offsets from the upper left corner of the
figure. Otherwise, the coordinates are interpreted as scaled
values in the range 0.0 to 1.0 across the figure. Note the
syntax is tolerant of repeated white space characters between
tokens.
TITLE
This is informational only and describes the object specified
with the HREF attribute. It can be used for object types that
don't possess titles, such as graphics, plain text and Gopher
menus.
REL
Used to describe the relationship of the linked object specified
with the HREF attribute. The set of relationship names is not
part of this specification, although "Path" and "Node" are
reserved for future use with hypertext paths or guided tours.
The REL attribute can be used to support search for links
serving particular relationships.
Dave Raggett Page 42
HTML 3.0 28th March 1995
REV
This defines a reverse relationship. A link from document A to
document B with REV=--relation-- expresses the same relationship
as a link from B to A with REL=--relation--. REV=made is
sometimes used to identify the document author, either the
author's email address with a --mailto-- URI, or a link to the
author's home page. Tables of contents can use anchors with
REV="ToC" to allow software to insert page numbers when printing
hypertext documents. The plain text version of this
specification was generated in this way!
Dave Raggett Page 43
HTML 3.0 28th March 1995
Overview of Character-Level Elements
Permitted Context: %text
Content Model: %text
Character level elements are used to specify either the structural
meaning or the physical appearence of marked text without causing a
paragraph break. Like most other elements, character level elements
include both start and end tags. Only the characters between the
tags are effected. For example:
This is emphasized text.
Highlighting elements are allowed within the content of other
highlighting elements, but implementations are not required to
render these nested highlighting elements distinctly from non-nested
elements. For example, implementations may render the following two
cases identically:
plain bold italic
plain bold italic
Some character highlighting styles are more explicit than others
about how they should be physically represented. Designate the
information type rather than the character format wherever possible,
unless for example, it is necessary to refer to the text as in "The
italic parts are mandatory".
Permitted Attributes
ID
An SGML identifier used as the target for hypertext links or for
naming particular elements in associated style sheets.
Identifiers are NAME tokens and must be unique within the scope
of the current document.
LANG
This is one of the ISO standard language abbreviations, e.g.
"en.uk" for the variation of English spoken in the United
Kingdom. It can be used by parsers to select language specific
choices for quotation marks, ligatures and hypenation rules etc.
The language attribute is composed from the two letter language
code from ISO 639, optionally followed by a period and a two
letter country code from ISO 3166.
CLASS
This a space separated list of SGML NAME tokens and is used to
subclass tag names. By convention, the class names are
interpreted hierarchically, with the most general class on the
left and the most specific on the right, where classes are
separated by a period. The CLASS attribute is most commonly used
to attach a different style to some element, but it is
Dave Raggett Page 44
HTML 3.0 28th March 1995
recommended that where practical class names should be picked on
the basis of the element's semantics, as this will permit other
uses, such as restricting search through documents by matching
on element class names. The conventions for choosing class names
are outside the scope of this specification.
Dave Raggett Page 45
HTML 3.0 28th March 1995
Information Type Elements
EM
The element provides typographic emphasis, typically
italics. While and often give the same effect, use
except where it is necessary in the text to refer to the
formatting, as in "The italic parts are mandatory". This will
help to ensure consistency between documents from various
sources if (for example) the reader prefers to use color in
place of italics for emphasis.
CITE
The element specifies a citation. Sections tagged with
the CITE element are typically rendered in italics.
STRONG
The element provides strong typographic emphasis,
typically bold.
CODE
The
Permitted Attributes for the LI Element
ID
An SGML identifier used as the target for hypertext links or for
naming particular elements in associated style sheets.
Identifiers are NAME tokens and must be unique within the scope
of the current document.
LANG
This is one of the ISO standard language abbreviations, e.g.
"en.uk" for the variation of English spoken in the United
Kingdom. It can be used by parsers to select language specific
choices for quotation marks, ligatures and hypenation rules etc.
The language attribute is composed from the two letter language
code from ISO 639, optionally followed by a period and a two
letter country code from ISO 3166.
CLASS
This a space separated list of SGML NAME tokens and is used to
subclass tag names. By convention, the class names are
interpreted hierarchically, with the most general class on the
left and the most specific on the right, where classes are
separated by a period. The CLASS attribute is most commonly used
to attach a different style to some element, but it is
recommended that where practical class names should be picked on
the basis of the element's semantics, as this will permit other
uses, such as restricting search through documents by matching
on element class names. The conventions for choosing class names
are outside the scope of this specification.
CLEAR
This attribute is common to all block-like elements. When text
flows around a figure or table in the margin, you sometimes want
to start the list item below the figure rather than alongside
it. The CLEAR attribute allows you to move down unconditionally:
Dave Raggett Page 57
HTML 3.0 28th March 1995
clear=left
move down until left margin is clear
clear=right
move down until right margin is clear
clear=all
move down until both margins are clear
Alternatively, you can decide to place the element alongside the
figure just so long as there is enough room. The minimum width
needed is specified as:
clear="40 en"
move down until there is at least 40 en units free
clear="100 pixels"
move down until there is at least 100 pixels free
The style sheet (or browser defaults) may provide default
minimum widths for each class of block-like elements.
SRC
Specifies an image for use as a bullet. The image is specified
as a URI. This attribute may appear together with the MD
attribute.
MD
Specifies a message digest or cryptographic checksum for the
associated graphic specified by the SRC attribute. It is used
when you want to be sure that a linked object is indeed the same
one that the author intended, and hasn't been modified in any
way. For instance, MD="md5:jV2OfH+nnXHU8bnkPAad/mSQlTDZ", which
specifies an MD5 checksum encoded as a base64 character string.
The MD attribute is generally allowed for all elements which
support URI based links.
DINGBAT
Specifies an iconic image for use as a bullet. The icon is
specified as an entity name. A list of standard icon entity
names for HTML 3.0 is given in an appendix of this
specification, e.g. folder is the entity name for an icon
denoting a directory or folder.
SKIP
Increments the sequence number before rendering the element. It
is used when headers have been left out of the sequence. For
instance, SKIP=3 advances the sequence number past 3 omitted
items.
Dave Raggett Page 58
HTML 3.0 28th March 1995
OL (Ordered List)
Permitted Context: %Body.Content, %flow, %block
Content Model: Optional list header (LH), followed by one or more
list items(LI)
An ordered list typically is a numbered list of items. HTML 3.0
gives you the ability to control the sequence number - to continue
where the previous list left off, or to start at a particular
number. The numbering style is left to associated style sheets, e.g.
whether nested lists contribute to a compound item number, e.g.
"3.1.5", or whether numbers are rendered as arabic, upper or lower
case roman numerals or using the numbering scheme appropriate to the
language context.
The opening list tag must be
Permitted Attributes for the DD Element
ID
An SGML identifier used as the target for hypertext links or for
naming particular elements in associated style sheets.
Identifiers are NAME tokens and must be unique within the scope
of the current document.
LANG
This is one of the ISO standard language abbreviations, e.g.
"en.uk" for the variation of English spoken in the United
Kingdom. It can be used by parsers to select language specific
choices for quotation marks, ligatures and hypenation rules etc.
The language attribute is composed from the two letter language
code from ISO 639, optionally followed by a period and a two
letter country code from ISO 3166.
CLASS
This a space separated list of SGML NAME tokens and is used to
subclass tag names. By convention, the class names are
interpreted hierarchically, with the most general class on the
left and the most specific on the right, where classes are
separated by a period. The CLASS attribute is most commonly used
to attach a different style to some element, but it is
recommended that where practical class names should be picked on
the basis of the element's semantics, as this will permit other
uses, such as restricting search through documents by matching
on element class names. The conventions for choosing class names
are outside the scope of this specification.
CLEAR
When text flows around a figure or table in the margin, you
sometimes want to start term definition below the figure rather
than alongside it. The CLEAR attribute allows you to move down unconditionally:
Dave Raggett Page 67
HTML 3.0 28th March 1995
clear=left
move down until left margin is clear
clear=right
move down until right margin is clear
clear=all
move down until both margins are clear
Alternatively, you can decide to place the element alongside the
figure just so long as there is enough room. The minimum width
needed is specified as:
clear="40 en"
move down until there is at least 40 en units free
clear="100 pixels"
move down until there is at least 100 pixels free
The style sheet (or browser defaults) may provide default
minimum widths for each class of block-like elements.
Dave Raggett Page 68
HTML 3.0 28th March 1995
Figures
Permitted Context: %body.content, %flow, %block
Content Model: Optional OVERLAYs followed by an optional CAPTION,
then %body.content and finally an optional CREDIT
The FIG element is used for figures. Subsequent elements will be
flowed around the figure if there is sufficient room. This behaviour
is disabled when the align attribute is --center-- (the default) or
--justify--.
Figure overlays provide for more effective use of caching as small
changes to a figure in a subsequent document incur only the penalty
of downloading the overlays and not the larger base figure, as the
latter is already in the cache.
The figure description text is intended to convey the content of the
figure for people with non-graphical user agents, while the figure
caption and credit are rendered on both graphical and non-graphical
user agents. The FIG element improves on the IMG element by allowing
authors to use markup for the description text. The content model
allows authors to include headers, which is appropriate when the
headers are part of the image data. It also allows graphical
hypertext links to be specified in the markup and interpreted by the
user agent rather than the server.
The anchor elements in the figure description text play a dual role:
Non-graphical user agents show conventional hypertext links, while
for graphical user agents, the same anchor elements specify
graphical hypertext links, with the SHAPE attribute designating the
hotzones. This is designed to simplify the task of authors writing
for both audiences. Hopefully, the FIG element will help to combat
the tendency for authors to forget about people limited to terminal
access or the visually impaired relying on text to speech, as the
new element forces you to write description text to define the
graphical hypertext links.
For some applications the hotzones are dynamically defined by
programs running on the server. HTML 3.0 allows clicks and drags to
be passed to the server with the IMAGEMAP attribute. Hotzones may
also be specified as part of the graphics data format e.g. as in
VRML. Hotzones in the FIG element take precedence over hotzones in
the graphics data, which in turn take precedence over passing events
to a server imagemap program.
Hotzones in overlay graphics data take precedence over hotzones in
figure data. Similarly, the imagemap attribute in overlays takes
precedence over the imagemap attribute for the figure. For a group
of overlapping overlays the precedence is determined by the order
the OVERLAY elements appear within the FIG element. Later overlays
take precedence over earlier ones.
Examples
Dave Raggett Page 69
HTML 3.0 28th March 1995
Photographic image with caption and credits:
A small hairy spider light fleshy red in color with a brown abdomen.
Select between:
New York from the air!
. Additionally, the end tags of some other
elements (e.g. P, LI, DT, DD) can be omitted as the position of the
end tag is clearly implied by the context.
The content of an element is a sequence of characters and nested
elements. Some elements, such as anchors, cannot be nested. Anchors
Dave Raggett Page 10
HTML 3.0 28th March 1995
and character highlighting may be put inside other constructs. The
content model for a tag defines the syntax permitted for the
content.
Note: The SGML declaration for HTML specifies SHORTTAG YES, which
means that there are other valid syntaxes for tags, such as NET
tags, ; and empty end tags, >. Until
support for these idioms is widely deployed, their use is strongly
discouraged.
------------------------------------------------------------------------------
Names
The element name immediately follows the tag open delimiter. An
element name consist of a letter followed by up to 72 letters,
digits, periods, or hyphens. Names are not case sensitive. For
example, H1 is equivalent to h1. This limit of 72 characters is set
by the NAMELEN parameter in the SGML declaration for HTML 3.0.
------------------------------------------------------------------------------
Attributes
In a start tag, white space and attributes are allowed between the
element name and the closing delimiter. An attribute typically
consists of an attribute name, an equal sign, and a value (although
some attributes may be just a value). White space is allowed around
the equal sign.
The value of the attribute may be either:
1. A string literal, delimited by single quotes or double quotes
2. A name token (a sequence of letters, digits, periods, or
hyphens)
In this example, a is the element name, href is the attribute name,
and http://host/dir/file.html is the attribute value:
Some implementations consider any occurrence of the > character to
signal the end of a tag. For compatibility with such
implementations, when > appears in an attribute value, you may want
to represent it with an entity or numeric character reference, such
as:
To put quotes inside of quotes, you can use single quotes if the
outer quotes are double or vice versa, as in:
Dave Raggett Page 11
HTML 3.0 28th March 1995
Alternatively, you use the character representation " as in:
The length of an attribute value (after replacing entity and numeric
character references) is limited to 1024 characters. This number is
defined by the LITLEN parameter in the SGML declaration for HTML
3.0.
Note: Some implementations allow any character except space or > in
a name token. Attributes values must be quoted only if they don't
satisfy the syntax for a name token.
Attributes with a declared value of NAME (e.g. ISMAP, COMPACT) may
be written using a minimized syntax. The markup:
can be written as:
Note: Unless you use the minimized syntax, some implementations
won't understand.
------------------------------------------------------------------------------
Undefined Tag and Attribute Names
It is an accepted networking principle to be conservative in that
which one produces, and liberal in that which one accepts. HTML
parsers should be liberal except when verifying code. HTML
generators should generate strictly conforming HTML. It is suggested
that where ever practical, parsers should at least flag the presence
of markup errors, as this will help to avoid bad markup being
produced inadvertently.
The behavior of WWW applications reading HTML documents and
discovering tag or attribute names which they do not understand
should be to behave as though, in the case of a tag, the whole tag
had not been there but its content had, or in the case of an
attribute, that the attribute had not been present.
------------------------------------------------------------------------------
Special Characters
The characters between the tags represent text in the ISO-Latin-1
character set, which is a superset of ASCII. Because certain
characters will be interpreted as markup, they should be represented
by markup -- entity or numeric character references, for instance
the character "&" must be represented by the entity &. See the
Special Characters section of this specification for more
information.
Dave Raggett Page 12
HTML 3.0 28th March 1995
------------------------------------------------------------------------------
Comments
To include comments in an HTML document that will be ignored by the
parser, surround them with . After the comment
delimiter, all text up to the next occurrence of --> is ignored.
Hence comments cannot be nested. White space is allowed between the
closing -- and >, but not between the opening
This is a Heading
This is a top level heading
Here is some text.
Second level heading
Here is some more text.
Use the DIV element together with header elements when you want to
make the hierarchical structure of a document explicit. This is
needed as header elements themselves only contain the text of the
header, and do not imply any structural division of documents into
sections. Header elements have the same content model as paragraphs,
that is text and character level markup, such as character emphasis,
inline images, form fields and math.
Headers play a related role to lists in structuring documents, and
it is common to number headers or to include a graphic that acts
like a bullet in lists. HTML 3.0 recognizes this with attributes
that assist with numbering headers and allow authors to specify a
custom graphic.
The numbering style is controlled by the style sheet, e.g.
1. The style sheet specifies whether headers are numbered, and
which style is used to render the current sequence number, e.g.
arabic, upper alpha, lower alpha, upper roman, lower roman or a
numbering scheme appropriate to the current language.
2. Whether the parent numbering is inherited, e.g. "5.1.d" where 5
is the current sequence number for H1 headers, 1 is the number
for H2 headers and 4 for H3 headers.
The seqnum and skip attributes can be used to override the default
treatment of header sequence numbers, and provide for a continuity
with numbered lists.
The dingbat or src attribute may be used to specify a bullet-like
graphic to be placed adjacent to the header. The positioning of this
graphic is controlled by the style sheet. The graphic is for
decorative purposes only and silently ignored on non-graphical HTML
user agents.
Word Wrapping
User agents are free to wrap lines at whitespace characters so as to
ensure lines fit within the current window size. Use the
Dave Raggett Page 29
HTML 3.0 28th March 1995
entity for the non-breaking space character, when you want to make
sure that a line isn't broken! Alternatively, use the NOWRAP
attribute to disable word wrapping and the
element to force
line breaks where desired.
--Netscape includes two tags: defines a
level 2 header that acts as a section header. By convention, the
class names are interpreted hierarchically, with the most
general class on the left and the most specific on the right,
where classes are separated by a period. The CLASS attribute is
most commonly used to attach a different style to some element,
but it is recommended that where practical class names should be
picked on the basis of the element's semantics, as this will
permit other uses, such as restricting search through documents
by matching on element class names. The conventions for choosing
class names are outside the scope of this specification.
ALIGN
Headings are usually rendered flush left. The ALIGN attribute
can be used to explicitly specify the horizontal alignment:
align=left
The heading is rendered flush left (the default).
align=center
The heading is centered.
Dave Raggett Page 30
HTML 3.0 28th March 1995
align=right
The heading is rendered flush right.
align=justify
Heading lines are justified where practical, otherwise this
gives the same effect as the default align=left setting.
For example:
This is a centered heading
Here is some text. and this is a flush right
heading
Here is some more text.
CLEAR
This attribute is common to all block-like elements. When text
flows around a figure or table in the margin, you sometimes want
to start an element like a header, paragraph or list below the
figure rather than alongside it. The CLEAR attribute allows you
to move down unconditionally:
clear=left
move down until left margin is clear
clear=right
move down until right margin is clear
clear=all
move down until both margins are clear
Alternatively, you can decide to place the element alongside the
figure just so long as there is enough room. The minimum width
needed is specified as:
clear="40 en"
move down until there is at least 40 en units free
clear="100 pixels"
move down until there is at least 100 pixels free
The style sheet (or browser defaults) may provide default
minimum widths for each class of block-like elements.
SEQNUM
A sequence number is associated with each level of header from
the top level (H1) to the bottom level (H6). This attribute is
used to set the sequence number associated with the header level
of the current element to a given number, e.g. SEQNUM=10.
Normally, the sequence number is initialized to 1 at the
Dave Raggett Page 31
HTML 3.0 28th March 1995
beginning of the document and incremented after each header
element. It is reset to 1 by any header element of a higher
level, e.g. an H1 header resets the sequence numbers for H2 to
H6. The style of header numbering is controlled by the style
sheet.
SKIP
Increments the sequence number before rendering the element. It
is used when headers have been left out of the sequence. For
instance, SKIP=3 advances the sequence number past 3 omitted
items.
DINGBAT
Specifies an iconic image to appear preceding the header. The
icon is specified as an entity name. A list of standard icon
entity names for HTML 3.0 is given in an appendix of this
specification.
SRC
Specifies an image to appear preceding the header. The image is
specified as a URI. This attribute may appear together with the
MD attribute.
MD
Specifies a message digest or cryptographic checksum for the
associated graphic specified by the SRC attribute. It is used
when you want to be sure that a linked object is indeed the same
one that the author intended, and hasn't been modified in any
way. For instance, MD="md5:jV2OfH+nnXHU8bnkPAad/mSQlTDZ", which
specifies an MD5 checksum encoded as a base64 character string.
The MD attribute is generally allowed for all elements which
support URI based links.
NOWRAP
The NOWRAP attribute is used when you don't want the browser to
automatically wrap lines. You can then explicitly specify line
breaks in headings using the BR element. For example:
This heading has wordwrap turned off
Dave Raggett Page 32
HTML 3.0 28th March 1995
Paragraphs
Permitted Context: %Body.Content, %flow, %block
Content Model: %text
The
and the BR element is used for explicit line breaksThe heading precedes the first paragraph
element to force
line breaks where desired.
--Netscape includes two tags:
and the BR element is used for explicit line breaks
Dave Raggett Page 35
HTML 3.0 28th March 1995
Line Breaks
Permitted Context: %text
Content Model: Empty!
Line break and tab elements can be used when you need a little more
control over how the browser renders the text. The
element is
used to force a line break.
For example:
This is the first line
and this is the second
and this the third
--Shouldn't we have a conditional line break element like Netscape's
WBR thats indicates where to break lines when needed and when
wordwrap is disabled? Rather than an element, shouldn't this be an
entity - is there one already defined for this purpose?--
Permitted Attributes
ID
An SGML identifier used as the target for hypertext links or for
naming particular elements in associated style sheets.
Identifiers are NAME tokens and must be unique within the scope
of the current document.
LANG
This is one of the ISO standard language abbreviations, e.g.
"en.uk" for the variation of English spoken in the United
Kingdom. It can be used by parsers to select language specific
choices for quotation marks, ligatures and hypenation rules etc.
The language attribute is composed from the two letter language
code from ISO 639, optionally followed by a period and a two
letter country code from ISO 3166.
CLASS
This a space separated list of SGML NAME tokens and is used to
subclass tag names. By convention, the class names are
interpreted hierarchically, with the most general class on the
left and the most specific on the right, where classes are
separated by a period. The CLASS attribute is most commonly used
to attach a different style to some element, but it is
recommended that where practical class names should be picked on
the basis of the element's semantics, as this will permit other
uses, such as restricting search through documents by matching
on element class names. The conventions for choosing class names
are outside the scope of this specification.
CLEAR
When text flows around a figure or table in the margin, you
sometimes want to start the next line below the figure rather
Dave Raggett Page 36
HTML 3.0 28th March 1995
than alongside it. The CLEAR attribute allows you to move down unconditionally:
clear=left
move down until left margin is clear
clear=right
move down until right margin is clear
clear=all
move down until both margins are clear
Alternatively, you can decide to place the element alongside the
figure just so long as there is enough room. The minimum width
needed is specified as:
clear="40 en"
move down until there is at least 40 en units free
clear="100 pixels"
move down until there is at least 100 pixels free
The style sheet (or browser defaults) may provide default
minimum widths for each class of block-like elements.
Dave Raggett Page 37
HTML 3.0 28th March 1995
Horizontal Tabs
Permitted Context: %text
Content Model: Empty!
The TAB element can be used when you want fine control over the
horizontal positioning. The TAB element is used with the
element indicates an example of code; typically
rendered in a mono-spaced font. Do not confuse with PRE.
SAMP
The element indicates a sequence of literal characters.
KBD
The element indicates text typed (keyboarded) by the user.
It might typically be used in an instruction manual.
VAR
The element indicates a variable name, and might typically
be used in an instruction manual.
DFN
The element indicates the defining instance of a term.
--New in 3.0--.
Q
The
element is used for a short quotation. It is typically
shown enclosed in quotation marks as appropriate to the language
context. For English these would be matching double or single
quotation marks, alternating for nested quotes. The language
context is set by the LANG attribute. --New in 3.0--.
LANG
The
is used for deleted text, for instance in legal
documents. --New in 3.0--.
An example:
This text contains an emphasized word.
Don't assume that it will be italic!
It was made with the EM
element. A cite is
often italic and has no formally required structure:
Moby Dick is a book title.
Dave Raggett Page 47
HTML 3.0 28th March 1995
Font Style Elements
These elements may be nested within one another. Browsers should,
where practical, aim to combine different types of highlighting as
required.
B (Boldface)
The element specifies that the enclosed text should be
displayed in a boldface. If this is not practical, an
alternative mapping is allowed.
I (Italic)
The element specifies that the enclosed text should be
displayed, if practical, in an italic font (or slanted).
TT (TeleType)
The element specifies that the enclosed text should be
displayed, if practical, in a fixed-pitch typewriter font.
U (Underline)
The element specifies that the enclosed text should be
displayed, if practical, as underlined. --Not widely supported--
S (Strike through)
The element specifies that the enclosed text should be
displayed with a horizontal line striking through the text. If
this is not practical, an alternative mapping is allowed. --New
in 3.0--.
BIG (Big print)
The element specifies that the enclosed text should be
displayed, if practical, using a big font (compared with the
current font). --New in 3.0--.
SMALL (Small print)
The element specifies that the enclosed text should be
displayed, if practical, using a small font (compared with
normal text). --New in 3.0--.
SUB (Subscript)
The element specifies that the enclosed text should be
displayed as a subscript, and if practical, using a smaller font
(compared with normal text). The ALIGN attribute for SUB is only
meaningful within the MATH element. --New in 3.0--.
SUP (Superscript)
The element specifies that the enclosed text should be
displayed as a superscript, and if practical, using a smaller
font (compared with normal text). The ALIGN attribute for SUP is
only applicable within the MATH element. --New in 3.0--.
An example:
Dave Raggett Page 48
HTML 3.0 28th March 1995
This text contains some bold italic text, some
struck through text and some small print.
Dave Raggett Page 49
HTML 3.0 28th March 1995
The IMG (Image) Element
Permitted Context: %text
Content Model: Empty!
The tag is used to incorporate in-line graphics (typically
icons or small graphics) into an HTML document. This element is NOT
intended for embedding other HTML text. For large figures with
captions and text flow see FIG element.
Example:
Browsers that cannot display in-line images ignore the IMG element
unless it contains the ALT attribute. Note that some browsers can
display (or print) linked graphics but not in-line graphics. If the
graphic is essential, you may want to create a link to it rather
than to put it in-line. If the graphic is essentially decorative,
then IMG is appropriate.
Permitted Attributes
ID
An SGML identifier used as the target for hypertext links or for
naming particular elements in associated style sheets.
Identifiers are NAME tokens and must be unique within the scope
of the current document.
LANG
This is one of the ISO standard language abbreviations, e.g.
"en.uk" for the variation of English spoken in the United
Kingdom. It can be used by parsers to select language specific
choices for quotation marks, ligatures and hypenation rules etc.
The language attribute is composed from the two letter language
code from ISO 639, optionally followed by a period and a two
letter country code from ISO 3166.
CLASS
This a space separated list of SGML NAME tokens and is used to
subclass tag names. By convention, the class names are
interpreted hierarchically, with the most general class on the
left and the most specific on the right, where classes are
separated by a period. The CLASS attribute is most commonly used
to attach a different style to some element, but it is
recommended that where practical class names should be picked on
the basis of the element's semantics, as this will permit other
uses, such as restricting search through documents by matching
on element class names. The conventions for choosing class names
are outside the scope of this specification.
SRC (Source)
The SRC attribute specifies the URI for the image to be
Dave Raggett Page 50
HTML 3.0 28th March 1995
embedded. Its syntax is the same as that of the HREF attribute
of the tag. SRC is mandatory.
MD
Specifies a message digest or cryptographic checksum for the
associated graphic specified by the SRC attribute. It is used
when you want to be sure that the image is indeed the same one
that the author intended, and hasn't been modified in any way.
For instance, MD="md5:jV2OfH+nnXHU8bnkPAad/mSQlTDZ", which
specifies an MD5 checksum encoded as a base64 character string.
The MD attribute is generally allowed for all elements which
support URI based links.
WIDTH
Optional suggested width for the image. By default, this is
given in pixels.
HEIGHT
Optional suggested height for the image. By default, this is
given in pixels.
UNITS
This optional attribute specifies the units for the width and
height attributes. It is one of: units=pixels (the default) or
units=en (half the point size).
ALIGN
Take values TOP or MIDDLE or BOTTOM, defining whether the top or
middle or bottom of the graphic should be aligned with the
baseline for the text line in which the IMG element appears.
With ALIGN=LEFT, the graphic will float down and over to the
current left margin, and subsequent text will wrap around the
right hand side of the graphic. Likewise for ALIGN=RIGHT, the
graphic aligns with the current right margin and, and text wraps
around the left. It is inappropriate to use this feature for
larger graphics as these are best represented with the FIG
element.
ALT (Alternate text)
Optional alternative text as an alternative to the graphics for
display in text-only environments. The alt text can contain
entities e.g. for accented characters or special symbols, but it
can't contain markup. The latter is possible, however, with the
FIG element.
ISMAP
An image map is a graphical map by which users can navigate
transparently from one information resource to another. The
ISMAP attribute identifies an image as an image map. The IMG
element can then be used as part of the label for a hypertext
link (see the anchor element). When the user clicks on the image
the location clicked is sent to the server designated by the
Dave Raggett Page 51
HTML 3.0 28th March 1995
hypertext link.
For example:
Note: There are drawbacks from having the server process clicks on
images: the delay in getting feedback and the inability to change
the pointer cursor on the fly as it moves over hotzones. Client-side
processing of events is possible if one of the following applies:
* The server may allow the image map to be downloaded and
processed locally. This should work with legacy documents
produced using earlier versions of HTML.
* Using an image format that includes image hotzones as part of
the file format.
* The FIG element provides for client-side image maps as a unified
part of the figure description. It offers a number of advantages
over IMG, including captions, markup in alt text and text flow
around figures.
Dave Raggett Page 52
HTML 3.0 28th March 1995
UL (Unordered List)
Permitted Context: %Body.Content, %flow, %block
Content Model: Optional list header (LH), followed by one or more
list items(LI)
An unordered list typically is a bulleted list of items. HTML 3.0
gives you the ability to customise the bullets, to do without
bullets and to wrap list items horizontally or vertically for
multicolumn lists.
The opening list tag must be . It is followed by an optional
list header (
which could be rendered as:
Table Fruit
* apples
* oranges
* bananas
Note: Some legacy documents may include headers or plain text before
the first LI element. Implementors of HTML 3.0 user agents are
advised to cater for this possibility in order to handle badly
formed legacy documents.
MENU and DIR elements
These elements are superceded by extensions to the UL element. User
agents are advised to continue to support them for the sake of
legacy documents. Both MENU and DIR consist of one or more LI
elements, similar to UL. MENU lists are typically rendered without
bullets in a more compact style than UL. You can get the same effect
with . DIR lists are used to present lists of items
containing up to 20 characters each. Items in a DIR list are
arranged in columns. You can get the same effect with
.
Permitted Attributes for the UL Element
ID
An SGML identifier used as the target for hypertext links or for
Dave Raggett Page 53
HTML 3.0 28th March 1995
naming particular elements in associated style sheets.
Identifiers are NAME tokens and must be unique within the scope
of the current document.
LANG
This is one of the ISO standard language abbreviations, e.g.
"en.uk" for the variation of English spoken in the United
Kingdom. It can be used by parsers to select language specific
choices for quotation marks, ligatures and hypenation rules etc.
The language attribute is composed from the two letter language
code from ISO 639, optionally followed by a period and a two
letter country code from ISO 3166.
CLASS
This a space separated list of SGML NAME tokens and is used to
subclass tag names. By convention, the class names are
interpreted hierarchically, with the most general class on the
left and the most specific on the right, where classes are
separated by a period. The CLASS attribute is most commonly used
to attach a different style to some element, but it is
recommended that where practical class names should be picked on
the basis of the element's semantics, as this will permit other
uses, such as restricting search through documents by matching
on element class names. The conventions for choosing class names
are outside the scope of this specification.
CLEAR
This attribute is common to all block-like elements. When text
flows around a figure or table in the margin, you sometimes want
to start an element like a header, paragraph or list below the
figure rather than alongside it. The CLEAR attribute allows you
to move down unconditionally:
clear=left
move down until left margin is clear
clear=right
move down until right margin is clear
clear=all
move down until both margins are clear
Alternatively, you can decide to place the element alongside the
figure just so long as there is enough room. The minimum width
needed is specified as:
clear="40 en"
move down until there is at least 40 en units free
Dave Raggett Page 54
HTML 3.0 28th March 1995
clear="100 pixels"
move down until there is at least 100 pixels free
The style sheet (or browser defaults) may provide default
minimum widths for each class of block-like elements.
PLAIN
The presence of this attribute suppresses the display of
bullets, e.g.
.
SRC
Specifies an image for use as a bullet. The image is specified
as a URI. This attribute may appear together with the MD
attribute.
MD
Specifies a message digest or cryptographic checksum for the
associated graphic specified by the SRC attribute. It is used
when you want to be sure that a linked object is indeed the same
one that the author intended, and hasn't been modified in any
way. For instance, MD="md5:jV2OfH+nnXHU8bnkPAad/mSQlTDZ", which
specifies an MD5 checksum encoded as a base64 character string.
The MD attribute is generally allowed for all elements which
support URI based links.
DINGBAT
Specifies an iconic image for use as a bullet. The icon is
specified as an entity name. A list of standard icon entity
names for HTML 3.0 is given in an appendix of this
specification, e.g. folder is the entity name for an icon
denoting a directory or folder.
WRAP
The WRAP attribute is used for multicolumn lists. Use wrap=vert
if you want to arrange the list items down the page before
wrapping to the next column. Use wrap=horiz if you want to
arrange the items across the page (less useful). The user agent
is responsible for determining how many columns are appropriate.
COMPACT
The presence of this attribute indicates the user agent should
use reduced interitem spacing. In practice, there are several
ways to increase the compactness of lists: reduced vertical
interitem spacing, smaller font size, or even to avoid line
breaks between items. This is best handled through associated
style sheets and the class attribute.
Dave Raggett Page 55
HTML 3.0 28th March 1995
LH (List Header)
Permitted Context: Immediately following UL, OL or DL
Content Model: %text
The LH or list header element is used to provide a title for a list.
User agents can use this in place of the full list when a mechanism
is provided to fold and unfold nested lists.
Permitted Attributes for the LH Element
ID
An SGML identifier used as the target for hypertext links or for
naming particular elements in associated style sheets.
Identifiers are NAME tokens and must be unique within the scope
of the current document.
LANG
This is one of the ISO standard language abbreviations, e.g.
"en.uk" for the variation of English spoken in the United
Kingdom. It can be used by parsers to select language specific
choices for quotation marks, ligatures and hypenation rules etc.
The language attribute is composed from the two letter language
code from ISO 639, optionally followed by a period and a two
letter country code from ISO 3166.
CLASS
This a space separated list of SGML NAME tokens and is used to
subclass tag names. By convention, the class names are
interpreted hierarchically, with the most general class on the
left and the most specific on the right, where classes are
separated by a period. The CLASS attribute is most commonly used
to attach a different style to some element, but it is
recommended that where practical class names should be picked on
the basis of the element's semantics, as this will permit other
uses, such as restricting search through documents by matching
on element class names. The conventions for choosing class names
are outside the scope of this specification.
Dave Raggett Page 56
HTML 3.0 28th March 1995
LI (List Item)
Permitted Context: UL or OL
Content Model: %flow
The LI or list item element is used for items in both ordered and
unordered lists.
Note: The content model for list items is quite broad, including
paragraphs, lists, performatted text, forms, tables, figures and
admonishments. Headers are not permitted, although implementors of
HTML 3.0 user agents are advised to cater for this possibility in
order to handle badly formed legacy documents. If %html.recommended
is active, the HTML 3.0 DTD expects you to enclose plain text in a
block element such as
. It is followed by an optional
list header (
which could be rendered as:
Meeting Agenda
1. Minutes of the last meeting
2. Do we need yet more meetings?
3. Any other business
Note: Some legacy documents may include headers or plain text before
the first LI element. Implementors of HTML 3.0 user agents are
advised to cater for this possibility in order to handle badly
formed legacy documents.
Permitted Attributes for the OL Element
ID
An SGML identifier used as the target for hypertext links or for
naming particular elements in associated style sheets.
Identifiers are NAME tokens and must be unique within the scope
of the current document.
LANG
This is one of the ISO standard language abbreviations, e.g.
"en.uk" for the variation of English spoken in the United
Kingdom. It can be used by parsers to select language specific
Dave Raggett Page 59
HTML 3.0 28th March 1995
choices for quotation marks, ligatures and hypenation rules etc.
The language attribute is composed from the two letter language
code from ISO 639, optionally followed by a period and a two
letter country code from ISO 3166.
CLASS
This a space separated list of SGML NAME tokens and is used to
subclass tag names. By convention, the class names are
interpreted hierarchically, with the most general class on the
left and the most specific on the right, where classes are
separated by a period. The CLASS attribute is most commonly used
to attach a different style to some element, but it is
recommended that where practical class names should be picked on
the basis of the element's semantics, as this will permit other
uses, such as restricting search through documents by matching
on element class names. The conventions for choosing class names
are outside the scope of this specification.
CLEAR
This attribute is common to all block-like elements. When text
flows around a figure or table in the margin, you sometimes want
to start an element like a header, paragraph or list below the
figure rather than alongside it. The CLEAR attribute allows you
to move down unconditionally:
clear=left
move down until left margin is clear
clear=right
move down until right margin is clear
clear=all
move down until both margins are clear
Alternatively, you can decide to place the element alongside the
figure just so long as there is enough room. The minimum width
needed is specified as:
clear="40 en"
move down until there is at least 40 en units free
clear="100 pixels"
move down until there is at least 100 pixels free
The style sheet (or browser defaults) may provide default
minimum widths for each class of block-like elements.
CONTINUE
Don't restart the sequence number, i.e. continue where previous
Dave Raggett Page 60
HTML 3.0 28th March 1995
list left off, e.g.
SEQNUM
Set the starting sequence number for the first item, e.g.
COMPACT
The presence of this attribute indicates the user agent should
use reduced interitem spacing. In practice, there are several
ways to increase the compactness of lists: reduced vertical
interitem spacing, smaller font size, or even to avoid line
breaks between items. This is best handled through associated
style sheets and the class attribute.
Dave Raggett Page 61
HTML 3.0 28th March 1995
DL - Definition Lists
Permitted Context: %Body.Content, %flow, %block
Content Model: Optional list header(LH), followed by one or more
terms(DT) and definitions(DD).
A definition list is a list of terms and corresponding definitions.
Definition lists are typically formatted with the term on the left
with the definition following on the right or on the next line. The
definition text is typically indented with respect to the term.
An alternative format places the term left aligned in a wide margin
and the definition on one or more lines to the right of the term. If
the DT term does not fit in the DT column (one third of the display
area), it may be extended across the page with the DD section moved
to the next line, or it may be wrapped onto successive lines of the
left hand column.
The opening list tag must be
. It is followed by an optional
list header (
which could be rendered as:
List Header
Term 1
This is the definition of the first term.
Term 2
This is the definition of the second term.
The definition list element can take the COMPACT attribute, which
suggests that a compact rendering be used, and is appropriate if the
list elements are small and/or the entire list is large.
Note: Use the NOTE element when you want to have an indented note.
The practice of using
Dave Raggett Page 64
HTML 3.0 28th March 1995
DT - Term Name
Permitted Context: DL
Content Model: %text
The DT tag element specifies a term name, and you can have several
terms per DD element.
Note: Term names are restricted to character level markup only,
including epmhasis, inline images and footnotes. Paragraph tags and
other block-like element such as headers are not permitted, although
implementors of HTML 3.0 user agents are advised to cater for this
possibility in order to handle badly formed legacy documents.
Permitted Attributes for the DT Element
ID
An SGML identifier used as the target for hypertext links or for
naming particular elements in associated style sheets.
Identifiers are NAME tokens and must be unique within the scope
of the current document.
LANG
This is one of the ISO standard language abbreviations, e.g.
"en.uk" for the variation of English spoken in the United
Kingdom. It can be used by parsers to select language specific
choices for quotation marks, ligatures and hypenation rules etc.
The language attribute is composed from the two letter language
code from ISO 639, optionally followed by a period and a two
letter country code from ISO 3166.
CLASS
This a space separated list of SGML NAME tokens and is used to
subclass tag names. By convention, the class names are
interpreted hierarchically, with the most general class on the
left and the most specific on the right, where classes are
separated by a period. The CLASS attribute is most commonly used
to attach a different style to some element, but it is
recommended that where practical class names should be picked on
the basis of the element's semantics, as this will permit other
uses, such as restricting search through documents by matching
on element class names. The conventions for choosing class names
are outside the scope of this specification.
CLEAR
When text flows around a figure or table in the margin, you
sometimes want to start the term name below the figure rather
than alongside it. The CLEAR attribute allows you to move down unconditionally:
clear=left
move down until left margin is clear
Dave Raggett Page 65
HTML 3.0 28th March 1995
clear=right
move down until right margin is clear
clear=all
move down until both margins are clear
Alternatively, you can decide to place the element alongside the
figure just so long as there is enough room. The minimum width
needed is specified as:
clear="40 en"
move down until there is at least 40 en units free
clear="100 pixels"
move down until there is at least 100 pixels free
The style sheet (or browser defaults) may provide default
minimum widths for each class of block-like elements.
Dave Raggett Page 66
HTML 3.0 28th March 1995
DD - Term Definition
Permitted Context: DL
Content Model: %flow
The DD tag element specifies a term definition, and follows one or
more DT elements.
Note: The content model for term definitions is quite broad,
including paragraphs, lists, performatted text, forms, tables,
figures and admonishments. Headers are not permitted, although
implementors of HTML 3.0 user agents are advised to cater for this
possibility in order to handle badly formed legacy documents. If
%html.recommended is active, the HTML 3.0 DTD expects you to enclose
plain text in a block element such as Access HP from Hewlett Packard
This would be rendered something like:
A test table with merged cells
/--------------------------------------------------\
| | Average | other | Misc |
| |-------------------| category |--------|
| | height | weight | | |
|-----------------------------------------|--------|
| males | 1.9 | 0.003 | | |
|-----------------------------------------|--------|
| females | 1.7 | 0.002 | | |
\--------------------------------------------------/
Dave Raggett Page 77
HTML 3.0 28th March 1995
There are several points to note:
* By default, header cells are centered while data cells are flush
left. This can be overriden by the ALIGN attribute for the cell;
the COLSPEC attribute for the TABLE element; or the ALIGN
attribute on the enclosing row's TR element (from the most
specific to the least).
* Cells may be empty.
* Cells spanning rows contribute to the column count on each of
the spanned rows, but only appear in the markup once (in the
first row spanned).
* If the column count for the table is greater than the number of
cells for a given row (after including cells for spanned rows),
the missing cells are treated as occurring on the right handside
of the table, and rendered as empty cells.
* The row count is determined by the TR elements - any rows
implied by cells spanning rows beyond this should be ignored.
* The user agent should be able to recover from a missing Average
other
categoryMisc
height weight
males 1.9 0.003
females 1.7 0.002
tag
prior to the first row as the TH and TC elements can only occur
within the TR element.
* It is invalid to have cells overlap, see below for an example.
In such cases, the rendering is implementation dependent.
An example of an invalid table:
which looks something like:
/-------------------\
| 1 | 2 | 3 | 4 | 5 |
| |---------------|
| | 6 | | | | The cells labelled 6 and 7 overlap!
|---|...|-----------|
| 7 : | 8 | | |
\-------------------/
Borderless tables are useful for layout purposes as well as their
traditional role for tabular data, for instance with fill-out forms:
name: [John Smith ]
card number: [4619 693523 20851 ]
Dave Raggett Page 78
HTML 3.0 28th March 1995
expires: [03] / [97]
telephone: [212 873 2739 ]
This can be represented as a table with one row and two columns. The
first column is right aligned, while the second is left aligned.
This example could be marked up as:
2 3 4 5
6
7 8
The use of such techniques is one of the motivations for using
nested tables, where borderless tables are used to layout cell
contents for an enclosing table
Hint: You can achieve a similar effect to the above by using decimal
alignment and using the DP attribute to set the alignment character
to a convenient character, for example:
name:
card number:
expires:
telephone:
/
Each line in the table is then indented so that all the colons are
positioned under one another.
Table Sizing Algorithm
The default sizing algorithm requires two passes through the table
data. In the first pass, word wrapping is disabled, and the user
agent keeps track of the minimum and maximum width of each cell. The
maximum width is given by the widest line. As word wrap has been
disabled, paragraphs are treated as long lines unless broken by
name:
card number:
expires: /
telephone:
elements. The minimum width is given by the widest word or image
Dave Raggett Page 79
HTML 3.0 28th March 1995
etc. taking into account leading indents and list bullets etc. In
other words, if you were to format the cell's content in a window of
its own, determine the minimum width you could make the window
before things begin to be clipped.
The minimum and maximum cell widths are then used to determine the
corresponding minimum and maximum widths for the columns. These in
turn, are used to find the minimum and maximum width for the table.
Note that cells can contain nested tables, but this doesn't
complicate the code significantly. The next step is to assign column
widths according to the current window size (more accurately - the
width between the left and right margins).
The table borders and intercell margins need to be included in the
assignment step. There are three cases:
1. The minimum table width is equal to or wider than the available
space. In this case, assign the minimum widths and allow the
user to scroll horizontally. For conversion to braille, it will
be necessary to replace the cells by references to notes
containing their full content. By convention these appear before
the table.
2. The maximum table width fits within the available space. In this
case, set the columns to their maximum widths.
3. The maximum width of the table is greater than the available
space, but the minimum table width is smaller. In this case,
find the difference between the available space and the minimum
table width, lets call it --W--. Lets also call --D-- the
difference between maximum and minimum width of the table.
For each column, let --d-- be the the difference between maximum
and minimum width of that column. Now set the column's width to
the minimum width plus --d-- times --W-- over --D--. This makes
columns with lots of text wider than columns with smaller
amounts.
This assignment step is then repeated for nested tables. In this
case, the width of the enclosing table's cell plays the role of the
current window size in the above description. This process is
repeated recursively for all nested tables.
If the COLSPEC attribute specifies the column widths explicitly, the
user agent can attempt to use these values. If subsequently, one of
the cells overflows its column width, the two pass mechanism may be
invoked to redraw the table with more appropriate widths. If the
attribute specifies relative widths, then the two pass model is
always needed.
The column width assignment algorithm is then modified:
* Explicit widths from the COLSPEC attribute should be used when
Dave Raggett Page 80
HTML 3.0 28th March 1995
given, provided they are greater than the minimum column width,
otherwise the latter should be used.
* For relative widths, the surplus space --W--, as defined above,
is divided up between the columns appropriately, ensuring that
each column is given at least its minimum width. If --W-- is
zero or negative, column widths should be increased over the
minimum width to meet the relative width requirements.
If the table width is specified with the WIDTH attribute, the user
agent attempts to set column widths to match. The WIDTH attribute
should be disregarded if this results in columns having less than
their minimum widths.
Permitted Attributes
ID
An SGML identifier used as the target for hypertext links or for
naming particular elements in associated style sheets.
Identifiers are NAME tokens and must be unique within the scope
of the current document.
LANG
This is one of the ISO standard language abbreviations, e.g.
"en.uk" for the variation of English spoken in the United
Kingdom. It can be used by parsers to select language specific
choices for quotation marks, ligatures and hypenation rules etc.
The language attribute is composed from the two letter language
code from ISO 639, optionally followed by a period and a two
letter country code from ISO 3166.
CLASS
This a space separated list of SGML NAME tokens and is used to
subclass tag names. By convention, the class names are
interpreted hierarchically, with the most general class on the
left and the most specific on the right, where classes are
separated by a period. The CLASS attribute is most commonly used
to attach a different style to some element, but it is
recommended that where practical class names should be picked on
the basis of the element's semantics, as this will permit other
uses, such as restricting search through documents by matching
on element class names. The conventions for choosing class names
are outside the scope of this specification.
CLEAR
When there is a figure or another table in the margin, you
sometimes want to start another table below the figure rather
than alongside it. The CLEAR attribute allows you to move down unconditionally:
clear=left
move down until left margin is clear
Dave Raggett Page 81
HTML 3.0 28th March 1995
clear=right
move down until right margin is clear
clear=all
move down until both margins are clear
Alternatively, you can decide to place the table alongside the
figure just so long as there is enough room. The minimum width
needed is specified as:
clear="40 en"
move down until there is at least 40 en units free
clear="100 pixels"
move down until there is at least 100 pixels free
The style sheet (or browser defaults) may provide default
minimum widths for each class of block-like elements.
NOFLOW
The presence of this attribute disables text flow around the
table. It avoids the need to use the CLEAR or NEEDS attributes
on the following element.
ALIGN
Specifies horizontal alignment of the table (--not-- its contents):
BLEEDLEFT
Flush left with the left (window) border.
LEFT
Flush left with the left text margin.
CENTER
The table is centered between the text margins and text flow
around the table is disabled. This is the default setting
for ALIGN.
RIGHT
Flush right with the right text margin.
BLEEDRIGHT
Flush right with the right (window) border
JUSTIFY
When applicable the table should be sized to fill the space
between the left and right text margins. Text flow around
the table is disabled for align=justify.
Dave Raggett Page 82
HTML 3.0 28th March 1995
UNITS
Specifies the choice of units for the COLSPEC attribute:
units=en
Specifies en units (a typographical unit equalt to half the
point size). This is the default setting and allows user
agents to render the table a row at a time without waiting
until all of the table's data has been received.
units=relative
Used to set the relative width of columns. The user agent
sums the values to determine the proportional width of each
column.
units=pixels
The least useful!
A design issue for user agents is how to handle cases where cell
contents won't fit into the specified column widths. One
approach is to clip the contents to the given column width,
another is to resize the columns to fit the contents regardless
of the COLSPEC attribute (its best to wait until all of the
table's data has been processed before resizing).
COLSPEC
The colspec attribute is a list of column widths and alignment
specifications. The columns are listed from left to right with a
capital letter followed by a number, e.g. COLSPEC="L20 C8 L40".
The letter is L for left, C for center, R for right alignment of
cell contents. J is for justification, when feasible, otherwise
this is treated in the same way as L for left alignment. D is
for decimal alignment, see DP attribute.
Capital letters are required to avoid a particularly common
error when a lower case L is confused with a one. Column entries
are delimited by one or more space characters.
The number specifies the width in en's, pixels or as a
fractional value of the table width, as according to the
associated units attribute. This approach is more compact than
used with most SGML table models and chosen to simplify hand
entry. The width attribute allows you to specify the width of
the table in pixels, em units or as a percentage of the space
between the current left and right margins.
DP
This specifies the character to be used for the decimal point
with the COLSPEC attribute, e.g. dp="." (the default) or dp=",".
The default may be altered by the language context, as set by
the LANG attribute on enclosing elements.
Dave Raggett Page 83
HTML 3.0 28th March 1995
WIDTH
This specifies the width of the table according to the UNITS
attribute. If units=relative, the width is taken as a percentage
of the width between the current left and right margins. The
user agent should disregard this attribute if it would result in
columns having less than their minimum widths.
BORDER
This presence of this attribute instructs the user agent to
render borders around tables. For instance: . The
precise appearence, along with the size of margins around cells,
can be controlled by associated style sheets, or via information
in the STYLE element in the document head. Subclassing tables,
rows and cells is particularly useful in this regard.
NOWRAP
The NOWRAP attribute is used when you don't want the browser to
automatically wrap lines. You can then explicitly specify line
breaks in paragrphs using the BR element.
Dave Raggett Page 84
HTML 3.0 28th March 1995
Table Rows
Permitted Context: TABLE
Content Model: Table Cells (TH or TD)
The TR element acts as a container for a row of table cells defined
with the TH or TD elements. You can set default horizontal and
vertical alignment of cell contents for the row. You also have the
ability to disable word wrap for the row, and thereafter use the
element to determine line breaks and hence cell widths.
To assist with formatting tables to paged media, authors can
differentiate leading and trailing rows that are to be duplicated
when splitting tables across page boundaries. The recommended
approach is to subclass rows using the CLASS attribute For example:
Paged browsers when splitting a table across a page boundary, can
then insert footer rows at the bottom of the current page and header
rows at the top of the next page, followed by the remaining body
rows, and the footer rows. This is repeated as necessary until all
of the body rows have been rendered. Refinements of this scheme can
be devised by further subclassing the rows together with an
appropriate style sheet.
Permitted Attributes for the TR Element
ID
An SGML identifier used as the target for hypertext links or for
naming particular elements in associated style sheets.
Identifiers are NAME tokens and must be unique within the scope
of the current document.
LANG
This is one of the ISO standard language abbreviations, e.g.
"en.uk" for the variation of English spoken in the United
Kingdom. It can be used by parsers to select language specific
choices for quotation marks, ligatures and hypenation rules etc.
The language attribute is composed from the two letter language
code from ISO 639, optionally followed by a period and a two
letter country code from ISO 3166.
CLASS
This a space separated list of SGML NAME tokens and is used to
subclass tag names. By convention, the class names are
interpreted hierarchically, with the most general class on the
left and the most specific on the right, where classes are
Dave Raggett Page 85
HTML 3.0 28th March 1995
separated by a period. The CLASS attribute is most commonly used
to attach a different style to some element, but it is
recommended that where practical class names should be picked on
the basis of the element's semantics, as this will permit other
uses, such as restricting search through documents by matching
on element class names. The conventions for choosing class names
are outside the scope of this specification.
ALIGN
The ALIGN attribute can be used to explicitly specify the
horizontal alignment of paragraphs within a table row:
align=left
Paragraphs are rendered flush left.
align=center
Paragraphs are centered.
align=right
Paragraphs are rendered flush right.
align=justify
Text lines are justified where practical, otherwise this
gives the same effect as the align=left setting.
align=decimal
Text lines are indented such that the first occurrence of a
decimal point on each line are aligned vertically. If a line
doesn't contain a decimal point, the line is rendered flush
left for data cells and centered for header cells.
Note: By default, header cells are centered while data cells are
flush left. This attribute can be used to alter these defaults
on a row by row basis. If you are specifying column alignments
with the TABLE's COLSPEC attribute, there is no point in also
including an ALIGN attribute with the TR element, as the latter
will be ignored.
DP
This specifies the character to be used for the decimal point
with the ALIGN attribute, e.g. dp="." (the default) or dp=",".
The default may be altered by the language context, as set by
the LANG attribute on enclosing elements.
VALIGN
The VALIGN attribute can be used to explicitly specify the
vertical alignment of material within a table row. It is
overridden by the VALIGN attribute on individual cells:
Dave Raggett Page 86
HTML 3.0 28th March 1995
valign=top
The cell contents appear at the top of each cell (the
default).
valign=middle
Cell contents are centered vertically in each cell.
valign=bottom
The cell contents appear at the bottom of each cell.
valign=baseline
This is used when you want to ensure that all cells in the
row share the same baseline. This constraint only applies to
the first text line for each cell.
NOWRAP
The NOWRAP attribute is used when you don't want the browser to
automatically wrap lines. You can then explicitly specify line
breaks in paragrphs using the BR element.
Dave Raggett Page 87
HTML 3.0 28th March 1995
Table Cells (TH and TD)
Permitted Context: TR
Content Model: %body.content
The TH and TD elements are used for table cells. TH is used for
table header cells while TD is used for table data cells. This
distinction gives user agents a means to render such cells
distinctly, for instance by using a larger or heavier font for
header cells. It is also needed when rendering to speech. The CLASS
attribute can be used to further differentiate cells, for instance
into heads and subheads. This can be used together with style sheets
to control the cell border style, and fill color etc.
The horizontal and vertical alignment of cell contents are
determined by the ALIGN and VALIGN attributes respectively. In their
absence, the alignment will be inherited from the TR element for the
row. The COLSPEC attribute of the enclosing TABLE element provides a
convenient way of specifying the default horizontal alignment for
columns.
The AXIS and AXES attributes can be used when rendering to speech to
provide abbreviated names for each cell's headers. Another
application is when you want to be able to later process table
contents to enter them into a database. Theses attributes are then
used to give database field names. The table's class attribute
should be used to let the software recognise which tables can be
treated in this way.
Note: Disabling word wrap and using the --header cells ...--
--body cells ...--
--footer cells ...--
element in order to
control cell widths is discouraged in favor of using the table
COLSPEC and WIDTH attributes.
Permitted Attributes for the TH/TD Element
ID
An SGML identifier used as the target for hypertext links or for
naming particular elements in associated style sheets.
Identifiers are NAME tokens and must be unique within the scope
of the current document.
LANG
This is one of the ISO standard language abbreviations, e.g.
"en.uk" for the variation of English spoken in the United
Kingdom. It can be used by parsers to select language specific
choices for quotation marks, ligatures and hypenation rules etc.
The language attribute is composed from the two letter language
code from ISO 639, optionally followed by a period and a two
letter country code from ISO 3166.
CLASS
This a space separated list of SGML NAME tokens and is used to
subclass tag names. By convention, the class names are
Dave Raggett Page 88
HTML 3.0 28th March 1995
interpreted hierarchically, with the most general class on the
left and the most specific on the right, where classes are
separated by a period. The CLASS attribute is most commonly used
to attach a different style to some element, but it is
recommended that where practical class names should be picked on
the basis of the element's semantics, as this will permit other
uses, such as restricting search through documents by matching
on element class names. The conventions for choosing class names
are outside the scope of this specification.
COLSPAN
The number of columns spanned by this cell. This allows you to
merge cells across columns. It defaults to 1 (one).
ROWSPAN
The number of rows spanned by this cell. This allows you to
merge cells across rows. It defaults to 1 (one).
ALIGN
The ALIGN attribute can be used to explicitly specify the
horizontal alignment of paragraphs within a table row:
align=left
Paragraphs are rendered flush left. This is the default for
data cells (TD).
align=center
Paragraphs are centered. This is the default for header
cells (TH).
align=right
Paragraphs are rendered flush right.
align=justify
Text lines are justified where practical, otherwise this
gives the same effect as the align=left setting.
align=decimal
Text lines are indented such that the first occurrence of a
decimal point on each line are aligned vertically. If a line
doesn't contain a decimal point, the line is rendered flush
left for data cells and centered for header cells.
Note: In the absence of the ALIGN attribute, the default is
overridden by the presence of an ALIGN attribute on the parent
TR element, or by the COLSPEC attribute on the TABLE element.
The COLSPEC attribute takes precedence over the TR element
though!
DP
This specifies the character to be used for the decimal point
Dave Raggett Page 89
HTML 3.0 28th March 1995
with the ALIGN attribute, e.g. dp="." (the default) or dp=",".
The default may be altered by the language context, as set by
the LANG attribute on enclosing elements.
VALIGN
The VALIGN attribute can be used to explicitly specify the
vertical alignment of material within a table cell:
valign=top
The cell contents appear at the top of each cell (the
default).
valign=middle
Cell contents are centered vertically in each cell.
valign=bottom
The cell contents appear at the bottom of each cell.
valign=baseline
This is used when you want to ensure that all cells in the
row with valign=baseline share the same baseline. This
constraint only applies to the first text line for each
cell.
Note: In the absence of the VALIGN attribute, the default can be
overridden by the presence of a VALIGN attribute on the parent
TR element.
NOWRAP
The NOWRAP attribute is used when you don't want the browser to
automatically wrap lines. You can then explicitly specify line
breaks in paragraphs using the BR element.
AXIS
This defines an abbreviated name for a header cell, which can be
used when rendering to speech. It defaults to the cell's
content.
AXES
This is a comma separated list of axis names which together
identify the row and column headers that pertain to this cell.
It is used when rendering to speech to identify the cell's
position in the table. If missing the user agent can try to
follow up columns and left along rows (right for some languages)
to find the corresponding header cells.
Note: a subheader cell may include both attributes - using AXIS
to name itself and AXES to name the parent header cell. When
data cells refer to header cells with both attributes, the
parent header cells are found by following back the head-subhead
relationships.
Dave Raggett Page 90
HTML 3.0 28th March 1995
Dave Raggett Page 91
HTML 3.0 28th March 1995
HTML Math
Permitted Context: %text
Content Model: %math
The