A tag that you apply to an individual character is called
character
tag. You can use two kinds of character tags: logical and physical.
Logical character tags indicate how you want to use text, not necessarily
how you want it displayed. Here's a list of some common logical character
tags.
|
Description |
<EM> | Indicates that characters should be emphasized in some
way, usually
displayed with italics. |
<STRONG> | Emphasizes characters more strongly than <EM>. Usually
displayed
in a bold font. |
<CODE> | Indicates a sample of code. Usually displayed in Courier
font or a
similar font that allots the same width to each character. |
<KBD> | Used to offset text that the user should enter. Often
displayed in a
Courier font or a similar font that allots the same width to each character. |
<VAR> | Indicates a variable. Often displayed in italics or underlined. |
<CITE> | Indicates short quotes or citations. Often italicized by browser. |
This is an example of the EM tag
This is an example of the STRONG tag
This is an example of the CODE tag
This is an example of the KBD tag
This is an example of the VAR tag
This is an example of a combination of the EM and STRONG tags
You can also support physical character tags
to
indicate exactly how characters are to be formatted. Here is a list of
common examples of physical character tags.
|
Description |
<B> | Indicate the text should be bold. |
<I> | Indicate the text should be italic. |
<TT> | Indicate the text should be used with a font like Courier
that allots the same
width to each character. |
<BIG> | Indicate the text should be displayed in a big font.
Available only in HTML
3.0 or above. |
<SMALL> | Indicate the text should be displayed in a small font.
Available only in HTML
3.0 or above. |
<SUB> | The text should be displayed as a subscript, in a smaller
font if possible
Available only in HTML 3.0 or above. |
<SUP> | The text should be displayed as a superscript, in a smaller
font if possible
Available only in HTML 3.0 or above. |
Some browser also support <U> tag for underlining text, but other browsers might not show underlining , so use it cautiously.
This is an example of the B tag
This is an example of the I tag
This is an example of the TT tag
This is an example of the BIG tag
This is an example of the small tag
This is an example of the sub tag
This is an example of the SUP tag
Given the presence of both logical and physical character
tags, which should you use to display some text in an italicized font:
<EM> or <I>? The answer depends on who will
view your web page. Some browsers like the UNIX browser Lynx, are text
based and cannot display italics. These browsers ignore the <I> tag,
so emphasis you want to place on a certain piece of text is lost. In this
case you would use logical tag. On the other hand, if you decide that only
graphical browser such as Netscape Navigator or Internet Explorer will
access your page, you might want to use a physical tag since it more
explicitly defines what resulting text looks like on the browser.