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



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 font’s 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 element’s width.
padding-left Any number of points (pt), inches (in), centimeters (cm), or pixels (px); or a percentage of the parent element’s width.
padding-right Any number of points (pt), inches (in), centimeters (cm), or pixels (px); or a percentage of the parent element’s width.
padding-top Any number of points (pt), inches (in), centimeters (cm), or pixels (px); or a percentage of the parent element’s 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 element’s width.
margin-right Auto; any number of points (pt), inches (in), centimeters (cm), or pixels (px); or a percentage of the parent element’s width.
margin-top Auto; any number of points (pt), inches (in), centimeters (cm), or pixels (px); or a percentage of the parent element’s width.
margin-bottom Auto; any number of points (pt), inches (in), centimeters (cm), or pixels (px); or a percentage of the parent element’s width.
vertical-align Baseline, sub, super, top, text-top, middle, bottom, text-bottom; or a percentage of the current line-height.


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.