|
To access the contents, click the chapter and section titles.
Platinum Edition Using HTML 4, XML, and Java 1.2
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.
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 youve 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 TagsHTML 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 its 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 FormattingText-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>
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:
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).
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.
|
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. |