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


POINT-SIZE=“number” (optional; Netscape Navigator 4 only) Specifies the desired font size for the text, in points. This allows for precise specification of font size and is an adjunct to the SIZE attribute.


Table 6.13 Some Supported Font Face Names with Examples

Font Name Example Font Name Example
Arial example Arial black example
Book Antiqua example Bookman example
Courier example Garamond example
Helvetica example Helvetica-narrow example
Modern example Palatino example
Times (Times New Roman) example

Equivalent functionality is available using style sheets, so authors should avoid this attribute and use style sheet rules instead.
SIZE=“+number,” “-number,” or “number” (optional) Specifies the desired font size for the text, either as an absolute size (“number”) or as a size relative to the size of the surrounding font —”+number” for a bigger font, “-number” for a smaller font. Absolute font sizes range from 1 (the smallest) to 7 (the largest), with the default value being 3. For example, <FONT SIZE="1"> requests the smallest possible font, while<FONT SIZE="-2"> requests a font two sizes smaller than the current font. The default font size (with respect to which relative sizes are calculated) can be reset via the BASEFONT element.
WEIGHT=“100,” “200,” “300,” . . . “900” (optional; Netscape Navigator 4 only) Specifies the font weight or degree of boldness. There are nine allowed values, ranging from “100” (lightest weight) to “900” (heaviest weight) in steps of 100. Equivalent functionality is available using style sheets, so authors should avoid this attribute and use style sheet rules instead.

I Element: Italics

I marks a section to be rendered in italics. If this is impossible, the browser can render it in some other way (lynx uses an underline).

S Element: Strike-Through

S marks a section to be rendered with a line struck through the text and is a synonym for STRIKE. If this is impossible, the browser can render this in some other way (lynx currently ignores this element). Note that HTML 4 marks this element as deprecated, indicating that this element is likely to be dropped in a future version of HTML. It should therefore be avoided as much as possible in new documents.

SMALL Element: Text with Smaller Font

Can Be Inside: Not allowed inside PRE

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

SPAN Element: Generic Container for Inline Text

SPAN is a generic container for inline text or markup and is essentially the inline equivalent of the block element DIV. There is no special formatting associated with SPAN content. However, style sheets can be used to apply specific formatting to spans of text. Indeed, this is the main intent of SPAN—to provide markup whereby a style sheet can apply formatting to specific blocks of inline text. In this sense, you


Figure 6.49 Example HTML document illustrating the use of the FONT element. Browser rendering of this document is shown in Figure 6.50.

<HTML><HEAD>
<TITLE> The FONT Element </TITLE>
</HEAD><BODY>&
ltH2 ALIGN="center"> The FONT Element </H2>

<FONT SIZE="+1"><B>Font Size</B> --</FONT>
You can use <B>FONT</B> to control font size. For example,
<FONT SIZE=2>t<FONT SIZE=3>h<FONT SIZE=4>i<FONT SIZE=5>s
<FONT SIZE=6>i</FONT>s </FONT>o</FONT>d</FONT>d </FONT>
looking, as I adjusted the size of each letter.
You can use this for large capital letters in
headings:
<p><FONT SIZE="+1">I</FONT>AN <FONT SIZE="+1">G</FONT>RAHAM'S
    <FONT SIZE="+1">H</FONT>OME
    <FONT SIZE="+1">P</FONT>AGE -- (with size change on
    leading letters)
<HR SIZE=4>
<FONT SIZE="+1"><B>Font Color -- </B></FONT>
You can can also control text color. For example,
the default text is black, but the following words are
<FONT COLOR="red">bright red</FONT>,
<FONT COLOR="#00ff00">bright green</FONT>, and
<FONT COLOR="#cccccc">light gray</FONT>. This of course, loses
some of its impact when printed in black and white....
<HR SIZE=4>
<FONT SIZE="+1"><B>Font Face -- </B></FONT>
Some browsers support font face control. This is nonstandardized,
and depends on (a) browser support for this extension, and (b) the 
presence of the font on your computer. Here is a table of
some examples:
<BR><BR>
<CENTER>
<TABLE WIDTH="80%" CELLPADDING=2 CELLSPACING=3
         BGCOLOR="#cccccc" BORDER>
<TR>
  <TD><FONT FACE="arial">Arial</FONT>
  <TD><FONT FACE="Book antiqua">Book antiqua</FONT>
  <TD><FONT FACE="Helvetica">Helvetica</FONT>
</TR>
<TR>
  <TD><FONT FACE="modern">modern</FONT>
  <TD><FONT FACE="times">times</FONT>
  <TD><FONT FACE="arial black">arial black</FONT>
</TR>
<TR>
  <TD><FONT FACE="bookman">bookman</FONT>
  <TD><FONT FACE="garamond">garamond</FONT>
  <TD><FONT FACE="helvetica-narrow">helvetica-narrow</FONT>
</TR><TR>
  <TD><FONT FACE="palatino">palatino</FONT>
  <TD><FONT FACE="lucida sans">lucida sans</FONT>
  <TD><FONT FACE="helvetica narrow"> &nbsp; </FONT>
</TR>
</TABLE>
</CENTER>
</BODY> </HTML>


Figure 6.50  Rendering, by the Netscape Navigator 3 browser, of the document shown in Figure 6.49. Note that these font names are not supported on all browsers, as discussed in the text.

can think of SPAN as a general-purpose successor to the FONT element.

STRIKE Element: Struck-Out Text

STRIKE marks a block of text to be struck out for some logical reason (typically, to indicate text that has been deleted). Lynx may render this is reverse-video. Note that HTML 4 marks this element as deprecated, indicating that it is likely to be dropped in a future version of HTML. It should therefore be avoided in new documents. The new INS and DEL elements, discussed later in this chapter, are designed for marking inserted or deleted sections of a document.

SUB Element: Subscript

Can Be Inside: Not allowed inside PRE


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.