[ToC] [Up] [Back] [Next] ... [Book Plug] The Information Commons
.................... Introduction to HTML

Logical: CITE | CODE | DFN | EM | KBD | SAMP | STRONG | VAR
Physical: B | BIG | FONT | I | SMALL | SUB | SUP | TT | U

4.11 Character Emphasis Modes

HTML allows you to specify special character highlighting or emphasis (eg boldface, italics, etc). These elements do NOT cause page breaks, and simply change the rendering of the characters enclosed inside the tags.

HTML allows you to specify these modes in two ways: Logically (by the logical meaning of the special text you wish to mark) and physically (by explicitly specifying the style you want, such as italics, boldfaced, underline, etc.). You are STRONGLY urged to use the logical renderings, as these will be more consistently interpreted from browser to browser.

Note that the logical styles may not be distinct (i.e. different logical styles may be rendered in the same way). Also, some browsers do not support all physical styles. For example, Mosaic does NOT support underlined text.

4.11.1 Elements Proposed by HTML 3

HTML 3 Proposed several new text emphasis elements, such as BIG and SMALL for bigger and smaller text, and SUP and SUB for superscripts and subscripts. These are integrated into HTML 3.2, and are implemented on most newer browsers (Navigator 2.0, Internet Explorer 3.0, etc.) You should be cautious in their user. Examples are given below, which will let you test the abilities of your own browser.

4.11.2 Elements proposed by Netscape and Microsoft

Netscape introduced the special element FONT, which controls the size of the font, on a scale from 1 to 7 (the basefont of the document can be set using the BASEFONT element -- e.g. <BASEFONT SIZE=2>). FONT is discussed in more detail below.

4.11.3 Logical Styles

Here are the different logical styles, and examples of the renderings:
EM
Emphasis (usually italics). For example the string <EM> this is example text </EM> is rendered:
this is example text.
STRONG
Stronger emphasis (usually bold). For example the string <STRONG> this is example strong text </STRONG> is rendered:
this is example strong text.
CODE
Example of typed code (usually fixed-width font). For example the string <CODE> this is example code </CODE> is rendered:
this is example code.
SAMP
A sequence of literal characters. For example the string <SAMP> this is example text </SAMP> is rendered:
this is example text.
KBD
Text to be marked as keyboard input: for example, in an instruction manual this would be the text typed by the user. For example the string <KBD> this is example text </KBD> is rendered:
"this is example text.
VAR
A variable name. For example, the string <VAR> this is example text </VAR> is rendered:
this is example text.
DFN
The defining instance of a term (often rendered bold or bold italic). For example <DFN> this is example text </DFN> is rendered:
this is example text.
CITE
A citation (typically rendered in italics). For example <CITE> this is example text </CITE> is rendered:
this is example text.

4.11.4 Physical Styles

These elements physically determine the desired renderings. Please try and use the logical forms, whenever possible.

The physical style elements, and their renderings, are:

TT
Fixed width typewriter font. For example <TT> this is example text </TT> is rendered:
this is example text.
B
Boldface where available (browser may render this in another manner if boldface is not possible). For example <B> this is example text </B> is rendered:
this is example text.
I
Italics (may be rendered as slanted in some cases) For example <I> this is example text </I> is rendered:
this is example text.
U (HTML 3)
Underline (may be rendered as slanted in some cases) For example <U> this is example text </U> is rendered:
this is example text
BIG (HTML 3)
Bigger text. For example <BIG> this is example text </BIG> is rendered:
this is example text.
SMALL (HTML 3)
Smaller text For example <SMALL> this is example text </SMALL> is rendered:
this is example text.
SUB (HTML 3.2)
Subscripts -- For example <SUB>sub</SUB>script is rendered:
subscript.
SUP (HTML 3.2)
Subscripts -- For example <SUP>sup</SUP>script is rendered:
supscript.
FONT (HTML 3.2 - with Netscape/Microsoft Extensions)
Fiddle the Font. This can be used, via the SIZE attribute (HTML 3.2) to control the font size. Thus <FONT SIZE="-1"> will select a slightly smaller font. For example <FONT SIZE="-1">smaller</FONT> is rendered:
smaller.

Microsoft (3.0) and Netscape (3.0) both allow you to select font faces. Thus <FONT FACE="arial,helvetica,times"> will select an arial font (and helvetica should Arial not be available, and finally Times-Roman should Helvetica not be available). For example, <FONT FACE="arial,helvetica">this is arial font </FONT> is rendered:
this is Arial or Helvetica.
Both browser also support font colors, via the COLOR attribute. Thus <FONT COLOR="#ff00aa">funny color</font> is rendered as funny color.


[ToC] [Up] [Back] [Next] ... [Book Plug] .................... Introduction to HTML

© Ian Graham 1994-1996 Page Last Updated: 25 November 1996