Click Here!
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


CITE Element: Citation

CITE marks a small citation—for example, a book or other document reference. Typically, this block of text will be rendered in italics, subject to the capabilities of the browser.

CODE Element: Typed Code

The CODE element marks a selection of typed computer code—for example, a single line of code from a program. Large selections of code should be displayed using a PRE element, which properly reproduces space characters and line breaks. CODE element contents should be rendered in a fixed-width typewriter font.

DFN Element: Defining Instance or Definition

DFN marks a selection of text as the defining instance of a term. The text content should be rendered in italics, as demonstrated by Internet Explorer. Netscape Navigator, however, renders DFN content with an unmodified font.

EM Element: Emphasis

EM marks a block of text for emphasis. Typically, the marked block of text is rendered in italics, subject to the capabilities of the browser. For example, lynx represents EM emphasized text by an underline.

KBD Element: Keyboard Input

KBD marks a block of text as keyboard input. Typically, this is displayed with a fixed-width typewriter font.

Q Element: Short Inline Quotation (Internet Explorer 4 Only)

Additional Attribute: CITE

Q marks an inline sequence of text that is a quotation. A browser should render this appropriate to the language, for example by surrounding the text with appropriate punctuation symbols, such as quotation marks. Q also supports an optional CITE attribute, which takes as its value a URL referencing the source of the quotation. This element is supported by Internet Explorer 4, although this browser does not assign any special formatting to the element—special formatting must be assigned, by the author, via a style sheet.

SAMP Element: Literal Characters

SAMP marks a block of text as a sequence of literal or sample characters. Typically, this is rendered in a fixed-width typewriter font.

STRONG Element: Strong Emphasis

STRONG marks a block of text for strong emphasis. Typically, this is rendered in boldface, although text-only browsers, such as lynx, use an underline (with lynx, EM and STRONG emphasis are displayed in the same way).

VAR Element: A Variable

VAR marks a variable name. This is typically rendered in italics or bold italics.

Physical Phrase-Level Elements

B Element: Boldface

B marks an inline block of text to be rendered in boldface. If this is impossible, the browser can render it in some other way (lynx uses an underline).

BIG Element: Text with Enlarged Font

Can Be Inside: Not allowed inside PRE

BIG marks text that should be rendered, when possible, with a font slightly larger than the font of the surrounding text. Enclosed images are not affected. BIG is ignored if a larger font is not available. BIG is equivalent to a FONT element with <FONT SIZE="+1">. Note that BIG is not allowed inside PRE. BIG is supported by Netscape Navigator 3, Internet Explorer 3, and later.

FONT Element: Select Text Font Size and Color

Can Be Inside: Not allowed inside PRE
Attributes: CLASS, DIR, ID, LANG, STYLE, TITLE,
COLOR, FACE, SIZE, (POINT-SIZE, WEIGHT: Netscape Navigator 4 only)

FONT marks text that should be rendered in modified color, size, or font face. FONT has no effect on enclosed IMG elements. FONT can take three attributes: SIZE for the font size, COLOR for the font color, and FACE for the font face. Note that FONT is not allowed inside PRE.


TIP:  Use Style Sheets Instead of FONT

If you are really worried about obtaining absolutely precise control over formatting and presentation by using the FONT element, then you should be reading the style sheets section in Chapter 7 instead. FONT is a very crude tool for typesetting documents, and the style sheet mechanisms provide much better ways of accomplishing the same things.


Examples showing the use of FONT are shown in Figures 6.49 and 6.50. The supported attributes and their meanings are:

COLOR=“#rrggbb,” or “color” (optional) Specifies the desired color for the text, either as a hexadecimal RGB code or as a named color. If using this attribute, be careful that the text color contrasts well with the display background.

FACE=“string” (optional) This attribute, introduced by Microsoft but now widely supported, lets an author specify the desired typeface (FACE=“Arial,” “Times,” etc.) to be used for the displayed text. Supported names depend on the fonts installed on the user’s computer and on the browser; for example, on a typical Windows 95 system, the name “Helvetica” works with Netscape Navigator 3 but not Internet Explorer 3. Note also that the names are tied to the Microsoft font names, and many fonts by these names are not found on other platforms (Macintosh or UNIX) or other PC operating systems (OS/2). On any system, FACE only works if the designated font is installed on the system.

FACE names are space sensitive. Thus to request the Arial black font you need FACE=“Arial black” and not FACE=“Arialblack.” Names are not, however, case sensitive.

You can specify multiple fonts by separating the font names by commas. Thus FACE=“Arial,helvetica,times” asks the browser to first try the Arial font, followed by Helvetica (if Arial is not present), and finally the times font (if Helvetica is not present).

Some font names are shown in Table 6.13 and are shown rendered in Figure 6.50.


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.