Free Web Hosting by Netfirms
Web Hosting by Netfirms | Free Domain Names by Netfirms

Table of Contents Home Page Web Taming's Free 'Net ToolsSite Search Table of Contents

Learning HTML: Inline Text Formatting


In this chapter we'll look at a few ways of structuring your text.

Logical Text Markup


Emphasized 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.

Strongly Emphasized Text

<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.

Definition of a Term

<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 Fragments

<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>&lt;CODE&gt;</code> is used for snippets of code which appear inside a paragraph of text.

Sample 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.

Keyboard

<kbd> Indicates text to be entered by the user.

Variable

<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.

Short Citations

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.

Abbreviations

<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

Acronyms

<acronym> Indicates an acronym (e.g., WAC, radar, etc.).

Q

<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.

SubScript and SuperScript

<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.

Jump to top[Top]


Physical Text Markup


TeleType Font

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.

Bold and Italics

<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?

Bigger, Smaller Text

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.

Jump to top[Top]


 [Prev] Previous Chapter | Home | Up | Next Chapter  [Next]


Send feedback and kudos to: peterconrad@hotmail.com
Copyright © 2004 by Web Taming . All Rights Reserved.
For more attractions please visit my Personal Pages on Planet Tripod.