|
|
|
In this chapter we'll look at a few ways of structuring your text.
<em> is used to indicate emphasized
text. While it is often rendered identical to <i>,
italics, using <em> rather than
<i> is preferred.
<p>It allows the browser to
distinguish between <em>emphasized
text</em> and other text
which can be drawn in <i>italics</i>.
It allows the browser to distinguish between emphasized text and other text which can be drawn in italics.
<strong> is used to indicate strongly
emphasized text. While it is often rendered identical to
<b>, using <strong>
rather than <b> is preferred.
<p>It allows the browser to
distinguish between <strong>strongly
emphasized text</strong>
and other text which must be drawn in <b>boldface</b>.
It allows the browser to distinguish between strongly emphasized text and other text which must be drawn in boldface.
<dfn> is used to mark up terms which
are used for the first time. These are often rendered in italics so the
user can see this is where the term is used for the first time.
<code> is used for snippets of code
which appear inside a paragraph of text. It is usually rendered in a
monospaced font.
The first sentance above looks like this in HTML:
<p><code><CODE></code>
is used for snippets of code which appear inside a paragraph of text.
<samp> is used to indicate sample
output from programs, scripts, etc..
<p>The text
<samp>General
Protection Fault</samp>
is well known to Windows users.
The text General Protection Fault is well known to Windows users.
<kbd> Indicates text to be entered by
the user.
<VAR> is used to mark up variables, for
example in discussions of computer programs. Using this tag allows
programs to automatically generate lists of the used variables.
<P>The variable
<VAR>c</VAR>
is used as a counter in this program.
The variable c is used as a counter in this program.
The <CITE> element indicates that the
text enclosed is cited from some reference. It could be rendered with
“smart quotes”, but usually browsers use italics.
<P><CITE>It could be rendered
with smart quotes, but usually browsers use italics.</CITE>
is cited from the above paragraph.
It could be rendered with smart quotes, but usually browsers use italics. is cited from the above paragraph.
<abbr> Indicates an abbreviated form
(e.g., WWW, HTTP, URI, Mass., etc.). The title
attribute gives the full text of the abbreviation.
<p><abbr title="World Wide Web">WWW</abbr>
WWW
<acronym> Indicates an acronym (e.g.,
WAC, radar, etc.).
<q cite="http://somewhere.com"> ... </q>
Indicates a short inline quotation. It should be rendered with “smart
quotes” in the browser. The cite
attribute is a URL to the original document
.
<sub> specifies that the text should be
rendered in subscript, with the enclosed text slightly lower than the
surrounding text. <sup> specifies
that the text should be rendered in superscript, with the enclosed text slightly
higher than the surrounding text.
<p>This is Super<sup>Script</sup>
and this is Sub<sub>Script</sub>.
This is SuperScript and this is SubScript.
The <TT> tag specifies that the
enclosed text should be rendered in a TeleType (monospaced) font. You
should use <CODE>,
<SAMP> or <KBD>
instead as these tags allow the browser to pick a suitable rendering for each
specific case, instead of the generic rendering you get with
<TT>.
<P><TT>This is a sample of Typewriter Text.</TT>
This is a sample of Typewriter Text.
<B> is used to indicate that the
enclosed text must be rendered in a bold typeface.
<I> is used to indicate that the enclosed text must be
rendered in an italic (slanted) typeface.
<P><B>This is the bold tag</B>
This is the bold tag.
<P><I>Care for italics?</I>
Care for italics?
The browser should draw the text in a larger font for
<BIG> and a smaller font for <SMALL>.
<P><BIG>This text</BIG>
is bigger than <SMALL>this text.</SMALL>
This text is bigger than this text.
Previous Chapter | Home |
Up | Next Chapter