HTML Encyclopaedia

Text font styles

HTML 3.2 includes no fewer than 23 container tags whose purpose is to control the appearance of the displayed text. Many of these are obsolescent or rarely used. These can be split into two groups, depending on whether they cause a line break or not. None of them have any attributes.

Block text tags

This group of 6 tags cause line breaks. Their effect is illustrated in the table below. In all cases the text This is a block <br>of two lines illustrating the effect of the <tag> tag. is included within the tags.

tagmeaningexample
addressContains an address. The devisors of HTML hoped that this would be used to enclose addresses so that addresses could be recognised as such by indexing and cataloguing software. The enclosed text is commonly rendered using an italic typeface. Microsoft Internet Explorer 3 seems to forget to switch out of italic on encountering </address> under some circumstances. This group of 6 tags cause line breaks. Their effect is illustrated in the table below. In all cases the text
This is a block
of two lines illustrating the effect of the <address> tag.
is included within the tags.
blockquoteEncloses blocks of text that are quotations, usually with distinguishing indentation This group of 6 tags cause line breaks. Their effect is illustrated in the table below. In all cases the text
This is a block
of two lines illustrating the effect of the <blockquote> tag.
is included within the tags.
listingEncloses preformatted text. Obsolete This group of 6 tags cause line breaks. Their effect is illustrated in the table below. In all cases the text This is a block
of two lines illustrating the effect of the <listing> tag
is included within the tags.
plaintextSwitches from HTML to preformatted text. Obsolete. The HTML 3.2 standard, suggests, incorrectly, that this is equivalent to <pre>, actually it is equivalent to </html> Netscape 3.0 gets this right, Microsoft Internet Explorer 3 gets it wrong, if you accept that HTML 3.2 got it wrong. No example included as this would cause Netscape 3.0 to break
preEncloses preformatted text. This group of 6 tags cause line breaks. Their effect is illustrated in the table below. In all cases the text
This is a block 
of two lines illustrating the effect of the <pre> tag.
is included within the tags.
xmpEncloses preformatted text. Obsolete This group of 6 tags cause line breaks. Their effect is illustrated in the table below. In all cases the text This is a block <br>of two lines illustrating the effect of the &lt;xmp&gt; tag. is included within the tags.

It is interesting that, using Microsoft Internet Explorer 3 the supposedly obsolete <listing>, <plaintext> and <xmp> have the effect of turning off all HTML mark-up interpretation. Using Netscape 3.0 only <xmp> has this effect. <listing> seems to imply a smaller typeface than <plaintext> and <xmp> using Microsoft Internet Explorer 3.0 The HTML 3.2 standard gives no hint of these aspects of browser behaviour.

In-line text tags

This group of 17 tags controls the appearance of in-line text. The <font> tag is not discussed in this document. It can be used to achieve some of the effects shown here.

These tags can be split into two broad groups known as font tags and phrase tags. These are sometimes known as physical and logical tags. The purpose of font tags is to control the physical appearance of the text whereas the phrase tags are intended to affect the interpretation of the contained text by software.

In particular the phrase tags could be used by software other than conventional browsers to, for example, render text in a special way for visually handicapped users or to guide the interpretation of text by cataloguing or indexing software. The fact that most HTML authors seem unaware of this means that the distinction is less useful than it ought to be.

Here's a list of all 17 tags showing their effect. It is normally possible to nest these tags to produce more complex effects but the results are, at best, unpredictable although experimentation can be great fun.

In the following table the text sat on the is enclosed within the tag in question. The table entries link to more detailed information about the particular tags.

tagtypemeaningexample
bfontboldthe cat sat on the mat
bigfontbig, i.e. one extra unit of size, equivalent to <font size=+1>the cat sat on the mat
citephrasecitation, used for citations and references to other sources - rarely usedthe cat sat on the mat
codephrasecode, used to show extracts of code from computer programsthe cat sat on the mat
dfnphrasedefinition, i.e. a defining instance of an item. The HTML 3.2 authors hope that browsers might collect such items and create a hyperlinked glossary of all items defined in a page the cat sat on the mat
emphraseemphasisthe cat sat on the mat
ifontitalicthe cat sat on the mat
kbdphrasekeyboard, used to indicate user keyboard input in computer software documentation - obsolescentthe cat sat on the mat
sampphrasesample, used to show sample output from computer programs etc.the cat sat on the mat
smallfontsmall, one less unit of size, equivalent to <font size=-1> the cat sat on the mat
strikefontstrike throughthe cat sat on the mat
strongphrasestrongthe cat sat on the mat
subfontsubscriptthe cat sat on the mat
supfontsuperscriptthe cat sat on the mat
ttfontteletype, i.e. monopitch textthe cat sat on the mat
ufontunderlinethe cat sat on the mat
varphrasevariable, used for variables or arguments to commands in computer software documentation - rarely usedthe cat sat on the mat

The descriptions are largely taken from the HTML 3.2 standard. In spite of the impression created by these descriptions, they can be used for purposes other than documenting computer software.