home account info subscribe login search My ITKnowledge FAQ/help site map contact us


 
Brief Full
 Advanced
      Search
 Search Tips
To access the contents, click the chapter and section titles.

HTML 4.0 Sourcebook
(Publisher: John Wiley & Sons, Inc.)
Author(s): Ian S. Graham
ISBN: 0471257249
Publication Date: 04/01/98

Bookmark It

Search this book:
 
Previous Table of Contents Next



Table 6.12 Physical Highlighting Elements and Recommended Formatting

Element Meaning
B boldface
BIG bigger text
FONT font size, face, or color
I italics
strike-through (equivalent to STRIKE)
SMALL smaller text
SPAN style sheet-specified formatting information
STRIKE strike-through (equivalent to S)
SUB subscript
SUP superscript
TT fixed-width font
U underlined

Can Be Inside: ADDRESS, BLOCKQUOTE, BODY, CAPTION, CENTER, DD, DIV, DT, FIELDSET, FORM, Hn, LI, NOFRAMES, NOSCRIPT, P, PRE, TD, TH,
character highlighting, A, APPLET, BUTTON, IFRAME, LABEL, LEGEND, OBJECT
Attributes: CLASS, DIR, ID, LANG, STYLE, TITLE, standard event handlers

There are four important exceptions to this content model:

1.  The elements BIG, FONT, SMALL, SUB, and SUP are not allowed inside PRE.
2.  The FONT element takes a different set of attributes. These attributes are discussed in the FONT element description.
3.  The BDO element takes a different set of attributes. These attributes are discussed in the BDO element description.
4.  The Q element takes an additional CITE attribute, discussed later in the Q element description.


Figure 6.47 HTML example document illustrating the different phrase markup elements. Figure 6.48 shows this document as displayed by the Internet Explorer 4 browser.

<HTML><HEAD>
<TITLE> Example of Phrase-Level Markup Elements </TITLE>
</HEAD>
<BODY BGCOLOR="#ffffff">
<UL>
  <LI> <FONT SIZE="+1" COLOR="red"><B>A) Logical
       Phrase-Level Markup </B></FONT>
  <LI> ABBR - An example abbreviation is <ABBR>abbr</ABBR>
  <LI> ACRONYM - An example acronym is <ABBR>radar</ABBR>
 <LI> BDO - This is <BDO DIR="rtl">bi-directional overriden</BDO> text
 <LI> CITE - This is <CITE>citation</CITE> text
 <LI> CODE - This is <CODE>typed computer code</CODE> text
 <LI> DFN - This is <DFN>a defining instance</DFN> text
 <LI> EM - This is <EM>emphasized</EM> text
 <LI> KBD - This is <KBD>keyboard input</KBD> text
 <LI> Q - Here is an <Q>inline quotation</Q> inside a sentence.
 <LI> SAMP - This is <SAMP>literal character</SAMP> text
 <LI> STRONG - This is <STRONG>strongly emphasized</STRONG> text
 <LI> VAR - This is <VAR>a variable</VAR> text
</UL>

<UL>
 <LI> <FONT SIZE="+1" COLOR="red"><B>B) Physical
        Phrase-Level Markup </B> </FONT>
 <LI> B - This is <B>boldfaced</B> text
 <LI> BIG - This is <BIG>bigger</BIG> text
 <LI> I - This is <I>italicized</I> text
 <LI> S - This is <S>strike-through</S> text
 <LI> SMALL - This is <SMALL>small</SMALL> text
 <LI> SPAN - This is an example of <SPAN>spanned</SPAN> text.
 <LI> STRIKE - This is <STRIKE>strike-out</STRIKE> text
 <LI> SUB - This is sub<SUB>script</SUB> text
 <LI> SUP - This is super<SUP>script</SUP> text
 <LI> TT - This is <TT>fixed-width typerwriter font</TT> text
 <LI> U - This is <U> underlined </U>text
</UL>

</UL>
  <LI> <FONT SIZE="+1" COLOR="red"><B>C) Special-Meaning
       Markup </B></FONT>
  <LI> INS - This is <INS>some inserted</INS> text
  <LI> DEL - This is <DEL>some deleted</DEL> text
</UL>
</BODY> </HTML>

You can nest highlighting modes inside one another. However, this is often not sensible with logical highlighting elements, given the rather specific meanings assigned to them—be careful that you are nesting things in a meaningful way! Note also that different browsers may interpret complicated nestings in different ways and that the resulting rendering can be unpredictable.

Physical highlighting elements can be nested; and these nestings (unlike those involving logical highlighting elements) often make sense. Therefore, requesting that a block of text be rendered in underlined, boldface italics is entirely reasonable.Examples of the different elements are shown in Figures 6.47 and 6.48.


Figure 6.48  Display, by the Internet Explorer 4 browser, of the document shown in Figure 6.47.

Logical Phrase-Level Elements

ABBR Element: An Abbreviation (Not Currently Supported)

ABBR marks an abbreviation, such as “Ont.” (for Ontario) or “Fr.” (for France). There is no special rendering associated with this element, although the TITLE attribute can be used to describe the origin of the acronym. For example:


<ABBR LANG="en" TITLE="Millisecond">ms</ABBR>

This element is not currently supported.

ACRONYM Element: An Acronym (Internet Explorer 4 only)

ACRONYM marks an acronym, such as HTTP or NATO. There is no special rendering associated with this element, although the TITLE attribute can be used to describe the origin of the acronym. For example:

<ABBR LANG="en" TITLE="HyperText Transfer Protocol">HTTP</ABBR>

The HTML specification does not recommend any special formatting for this element. This element is currently supported by Internet Explorer 4, which can set special rendering using a style sheet.

BDO Element: Bi-Directional Override (Not Currently Supported)

Attributes: CLASS, DIR, ID, LANG, STYLE, TITLE

BDO marks an inline section of text for bi-directional-override. The purpose is to force a particular directionality to the characters within the element, regardless of their intrinsic (or language-implied) directional properties. DIR is thus a mandatory attribute for BDO, while all other attributes are optional.

Note that BDO does not support any of the event-handler attributes. Note also that BDO is not supported by either Netscape Navigator 4 or Internet Explorer 4.


Previous Table of Contents Next


Products |  Contact Us |  About Us |  Privacy  |  Ad Info  |  Home

Use of this site is subject to certain Terms & Conditions, Copyright © 1996-2000 EarthWeb Inc.
All rights reserved. Reproduction whole or in part in any form or medium without express written permission of EarthWeb is prohibited. Read EarthWeb's privacy statement.