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.

Platinum Edition Using HTML 4, XML, and Java 1.2
(Publisher: Macmillan Computer Publishing)
Author(s): Eric Ladd
ISBN: 078971759x
Publication Date: 11/01/98

Bookmark It

Search this book:
 
Previous Table of Contents Next


Attributes:

The <BODY> tag takes the following attributes, which focus on global background and coloring properties. Each color-related attribute can be set equal to one of the 16 reserved color names (BLACK, WHITE, AQUA, SILVER, GRAY, MAROON, RED, PURPLE, FUSCHIA, GREEN, LIME, OLIVE, YELLOW, NAVY, BLUE, and TEAL) or to an RGB hexadecimal triplet.

  ALINK—Set equal to the color you want to paint active links (a link is active in the instant that the user clicks it).
  BACKGROUND—Set equal to the URL of an image to use in the document background. The image will be horizontally and vertically tiled if it is not large enough to fill the entire browser screen.
  BGCOLOR—Set equal to the color you want to paint the document’s background.
  LINK—Set equal to the color you want to paint unvisited links. (A link is unvisited if a user has yet to click it.)
  TEXT—Set equal to the color you want to paint the body text of the document.
  VLINK—Set equal to the color you want to paint visited links. (A link is visited if a user has already clicked it.)


NOTE:  All the attributes listed have been deprecated in favor of using style sheet characteristics to specify the same information.

Example:

<BODY BGCOLOR=”white” TEXT=”#FF0088" LINK=”#DD0F00" VLINK=”#00FF9A”>
... all document body content and HTML code goes here ...
</BODY>

Related Tags:

Dozens of tags are allowed between the <BODY> and </BODY> tags. In fact, with the exception of some of the frame-related tags, any tag in the rest of the chapter can be placed between <BODY> and </BODY>.

By putting together what you’ve learned in this section, you can come up with a generic HTML document template such as the following:

<HTML>
<HEAD>
<TITLE>Document Template</TITLE>
... <META>, <BASE>, <LINK>, <SCRIPT>, <STYLE>, <ISINDEX> tags ...
</HEAD>
<BODY>
... document body content and tags ...
</BODY>
</HTML>

When creating a new document, you can use this code to get started, and then fill in tags and other information according to your needs.

Formatting Tags

HTML provides a host of tags that you can use to change how text is displayed on a browser screen. After all, 12-point Times Roman gets a little tiring after a while, and it’s nice to give a reader an occasional break from a sea of ordinary text.

You can apply formatting instructions at two levels within a document. The first is at the text level, which means you are marking up at least a single character, but often much more than that. The second is at the paragraph or block level, which means you are formatting a specific logical chunk of the document. This section looks at both types of markup, starting with text-level formatting.

Text-Level Formatting

Text-level formatting can occur in one of two ways. An HTML tag that formats text can make changes to the font properties of the text (font formatting or physical styles), or it can describe how the text is being used in the context of the document (phrase formatting or logical styles). The next two sections introduce you to the tags used for each type of formatting.

Font Formatting

<B>

Type:

Container

Function:

Contains text to be rendered in boldface (see Figure 3.1).

Syntax:

<B> ... bold text goes here ... </B>


FIGURE 3.1  Boldface text stands out from the plain text around it, drawing the reader’s attention to it.

Attributes:

None.

Example:

<B>First Name:</B> <INPUT TYPE=”TEXT” NAME=”fname”>

<BASEFONT>

Type:

Standalone

Function:

Sets base size, color, and typeface properties for the body text font. The <BASEFONT> tag and all its attributes have been deprecated in favor of using style sheets.

Syntax:

<BASEFONT SIZE=”size” COLOR=”color” FACE=”list_of_typefaces”>

Attributes:

<FONT> can take any combination of the following attributes:

  COLOR—Set to any of the 16 reserved, English-language color names or an RGB hexadecimal triplet. The default font color is black.
  FACE—Set to a list of typefaces that the browser should use to render the text. The browser will use the first face in the list if that face is available. If not, it will work through the rest of the list and use the first face it finds available.
  SIZE—Set equal to an integer value between 1 and 7. This number is mapped to a font size in points by the browser, according to the user’s preferences. The default SIZE value is 3.

Example:

<BASEFONT SIZE=5 COLOR=”navy” FACE=”Arial,Helvetica,Times”>

Related Tags:

The <FONT> tag is typically used if you need to modify any of the base font properties specified in the <BASEFONT> tag. The <FONT> tag has been deprecated as well.

<BIG>

Type:

Container

Function:

Contains text to be rendered in a font size bigger than the default font size (see Figure 3.2).


FIGURE 3.2  Using the <BIG> tag increases the point size that text is rendered in.

Syntax:

<BIG> ... big text goes here ... </BIG>

Attributes:

None.

Example:

<BIG>D</BIG>rop <BIG>C</BIG>aps are a nice onscreen effect.

Related Tags:

The <SMALL> tag has the opposite effect (see later in this chapter).

<FONT>

Type:

Container

Function:

Contains text whose font properties are to be modified. Like most tags that specify presentation information, <FONT> has been deprecated by the W3C.

Attributes:

Note that the <FONT> tag has the same attributes as the <BASEFONT> tag. <FONT> is used to change font properties from the base values provided in the <BASEFONT> tag or from their default values. SIZE can be set to a value between 1 and 7, or it can be set equal to how much larger or smaller you want the font size to go (-1 for one size smaller, +3 for three sizes larger, and so forth). COLOR and FACE work exactly as they did for the <BASEFONT> tag.

Example:

<FONT SIZE=+1 COLOR=”red”>Warning! Warning!</FONT> Danger, Will Robinson!

Related Tags:

<FONT> changes properties specified in the <BASEFONT> tag.


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.