|
|
|
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
NOTE: When setting colors in your style sheet file, you can use one of the 16 English-language color names or an RGB hexadecimal triplet to describe the color. The acceptable English-language color names are
- AQUA
- BLACK
- BLUE
- FUCHSIA
- GRAY
- GREEN
- LIME
- MAROON
- NAVY
- OLIVE
- PURPLE
- RED
- SILVER
- TEAL
- WHITE
- YELLOW
Remember that the syntax for specifying a characteristic has the form
{characteristic: value}
Multiple characteristic/value pairs should be separated by semicolons. For example:
P {font: 14 pt Times New Roman; line-height: 16 pt; color: black}
CAUTION:
When you first start to work with style sheets, you may be tempted to use the syntax characteristic=value. Make sure you use the {characteristic: value} syntax previously noted.
The Cascading Style Sheet specification enables you to specify more than fonts, typefaces, and colors. Table 9.1 lists the different font and block level style attributes you can assign to a file containing style information.
Table 9.1 Font and Block Level Characteristics Permitted in Style Sheets
|
|
Characteristic
| Possible Values
|
|
font-family
| Any typeface available to the browser through Windows (the default font is used if one of the specified fonts is not available).
|
font-size
| Any size in points (pt), inches (in), centimeters (cm), or pixels (px); larger or smaller (relative-size values); xx-small, x-small, small, medium, large, x-large, xx-large (absolute-size values); or a percentage relative to the parent fonts size.
|
font-weight
| Normal, bold; bolder, lighter (relative weights).
|
font-style
| Normal, italic, oblique.
|
font-variant
| Normal, small caps.
|
color
| Any RGB hexadecimal triplet or HTML 4.0 English-language color name.
|
background-attachment
| (Whether the background image stays fixed or scrolls with the content) scroll, fixed.
|
background-color
| Transparent; any RGB hexadecimal triplet or HTML 4.0 English-language color name.
|
background-image
| None; URL of image file.
|
background-repeat
| Repeat-x (tile background image only in the horizontal direction), repeat-y (tile only in the vertical direction), repeat (tile in both directions), no-repeat (no tiling).
|
border-color
| Any RGB hexadecimal triplet or HTML 4.0 English-language color name.
|
border-style
| None, dashed, dotted, solid, double, groove, ridge, inset, outset.
|
border-bottom-width
| Thin, medium, thick; any number of points (pt), inches (in), centimeters (cm), or pixels (px).
|
border-left-width
| Thin, medium, thick; any number of points (pt), inches (in), centimeters (cm), or pixels (px).
|
border-right-width
| Thin, medium, thick; any number of points (pt), inches (in), centimeters (cm), or pixels (px).
|
border-top-width
| Thin, medium, thick; any number of points (pt), inches (in), centimeters (cm), or pixels (px).
|
float
| Left, right, none; floats positioned content in left or right margin.
|
padding-bottom
| Any number of points (pt), inches (in), centimeters (cm), or pixels (px); or a percentage of the parent elements width.
|
padding-left
| Any number of points (pt), inches (in), centimeters (cm), or pixels (px); or a percentage of the parent elements width.
|
padding-right
| Any number of points (pt), inches (in), centimeters (cm), or pixels (px); or a percentage of the parent elements width.
|
padding-top
| Any number of points (pt), inches (in), centimeters (cm), or pixels (px); or a percentage of the parent elements width.
|
text-align
| Left, center, right, justify.
|
text-decoration
| None, underline, overline, line-through, blink.
|
text-indent
| Any number of points (pt), inches (in), centimeters (cm), or pixels (px); or a percentage relative to the indentation of the parent element.
|
text-shadow
| The shadow offset is required and can be set to any number of points (pt), inches (in), centimeters (cm), or pixels (px); specification of blur radius and shadow color is optional.
|
text-transform
| Capitalize, uppercase, lowercase, none.
|
line-height
| Normal; any number of points (pt), inches (in), centimeters (cm), or pixels (px); or a percentage of the font size.
|
letter-spacing
| Normal; any number of points (pt), inches (in), centimeters (cm), or pixels (px).
|
word-spacing
| Normal; any number of points (pt), inches (in), centimeters (cm), or pixels (px).
|
margin-left
| Auto; any number of points (pt), inches (in), centimeters (cm), or pixels (px); or a percentage of the parent elements width.
|
margin-right
| Auto; any number of points (pt), inches (in), centimeters (cm), or pixels (px); or a percentage of the parent elements width.
|
margin-top
| Auto; any number of points (pt), inches (in), centimeters (cm), or pixels (px); or a percentage of the parent elements width.
|
margin-bottom
| Auto; any number of points (pt), inches (in), centimeters (cm), or pixels (px); or a percentage of the parent elements width.
|
vertical-align
| Baseline, sub, super, top, text-top, middle, bottom, text-bottom; or a percentage of the current line-height.
|
|
|