start page | rating of books | rating of authors | reviews | copyrights

HTML: The Definitive Guide

Previous Appendix C Next
 

C. Cascading Style Sheet Properties Quick Reference

In the following table, we list in alphabetical order all the properties defined in the World Wide Web Consortium's Recommended Specification for Cascading Style Sheets, Level 1 (http://www.w3.org/pub/WWW/TR/REC-CSS1).

NOTE:

We know that browser support of style sheets will change faster than we can reprint this book, so we have created a separate "compliance document" that you can use to determine how style sheets are implemented by the latest releases of the browsers. You can find this document at http://www.ora.com/info/html /. Whenever that document and this appendix differ, the document should be considered more accurate.

As in other sections of this book, we use the Netscape and Microsoft icons to the far right of each property to show which browser supports that property. Properties with no icons are not currently supported by any browser.

We also include the number of the section in this book that fully defines the property.

We include each property's possible values, defined as either an explicit keyword (shown in constant width) or as one of these values:

color

Either a color name or hexadecimal RGB value, as defined in Appendix F, Color Names and Values, or an RGB triple of the form

rgb(red, green, blue)

where red, green, and blue are either numbers in the range 0 to 255 or percentage values indicating the brightness of that color component. Values of 255 or 100% indicate that the corresponding color component is at its brightest; values of 0 or 0% indicate that the corresponding color component is turned completely off. For example,

rgb(27, 119, 207)
rgb(50%, 75%, 0%)

are both valid color specifications.

length

An optional sign (either + or -) immediately followed by a number (with or without a decimal point) immediately followed by a two-character unit identifier. For values of zero, the unit identifier may be omitted.

The unit identifiers em and ex refer to the overall height of the font and to the height of the letter "x", respectively. The unit identifier px is equal to a single pixel on the display device. The unit identifiers in, cm, mm, pt, and pc refer to inches, centimeters, millimeters, points, and picas, respectively. There are 72.27 points per inch, and 12 points in a pica.

number

An optional sign, immediately followed by a number (with or without a decimal point).

percent

An optional sign, immediately followed by a number (with or without a decimal point), immediately followed by a percent sign. The actual value is computed as a percentage of some other element property, usually the element's size.

url

The keyword url, immediately followed (no spaces) by a left parenthesis, followed by a URL optionally enclosed in single or double quotes, followed by a matching right parenthesis. For example,

url("http://members.aol.com/htmlguru")

is a valid URL value.

Finally, some values are lists of other values and are described as a "list of" some other value. In these cases, a list consists of one or more of the allowed values, separated by commas.

If there are several different values allowed for a property, these alternative choices are separated by vertical bars (|).

If the standard defines a default value for the property, that value is in boldface.

background

 

Composite property for the background-attachment,background-color, background-image, background-position, and background-repeat properties; value is any of these properties' values, in any order

9.3.4.6

(Netscape) (Internet Explorer)

background- attachment

scroll | fixed

Determines if the background image is fixed in the window or scrolls as the document scrolls

9.3.4.1

(Netscape)

background-color

color | transparent

Sets the background color of an element

9.3.4.2

(Netscape)

background-image

url | none

Sets the background image of an element

9.3.4.3

(Netscape)

background-position

percent | length | top | center | bottom | left | right

Sets the initial position of the element's background image, if specified; values are normally paired to provide x, y positions. Default position is 0% 0%

9.3.4.4

(Netscape)

background-repeat

repeat | repeat-x | repeat-y | no-repeat

Determines how the background image is repeated (tiled) across an element

9.3.4.5

(Netscape)

border

 

Sets all four borders on an element; value is one or more of a color, a value for border-width, and a value for border-style

9.3.6.6

 

border-bottom

 

Sets the bottom border on an element; value is one or more of a color, a value for border-bottom-width, and a value for border-style

9.3.6.6

 

border-bottom-width

length | thin | medium | thick

Sets the thickness of an element's bottom border

9.3.6.4

 

border-color

color

Sets the color of all four of an element's borders; default is the color of the element

9.3.6.3

 

border-left

 

Sets the left border on an element; value is one or more of a color, a value for border-left-width, and a value for border-style

9.3.6.6

 

border-left-width

length | thin | medium | thick

Sets the thickness of an element's left border

9.3.6.4

 

border-right

 

Sets the right border on an element; value is one or more of a color, a value for border-right-width, and a value for border-style

9.3.6.6

 

border-right-width

length | thin | medium | thick

Sets the thickness of an element's right border

9.3.6.4

 

border-style

dashed | dotted | double| groove | inset | none | outset| ridge | solid

Sets the style of all four of an element's borders

9.3.6.5

 

border-top

 

Sets the top border on an element; value is one or more of a color, a value for border-top-width, and a value for border-style

9.3.6.6

 

border-top-width

length | thin | medium | thick

Sets the thickness of an element's top border

9.3.6.4

 

border-width

length | thin | medium | thick

Sets the thickness of all four of an element's borders

9.3.6.4

 

clear

both | left | none| right

Sets which margins of an element must not be adjacent to a floating element; the element will be moved down until that margin is clear

9.3.6.7

(Netscape)

color

color

Sets the color of an element

9.3.4.7

(Netscape) (Internet Explorer)

display

block | inline | list-item| none

Controls how an element is displayed

9.3.8.1

 

float

left | none | right

Determines if an element will float to the left or right, allowing text to wrap around it, or be displayed inline (using none)

9.3.6.8

(Netscape)

font

 

Sets all the font attributes for an element; value is any of the values for font-style, font-variant, font-weight, font-size, line-height, and font-family, in that order

9.3.3.6

(Netscape) (Internet Explorer)

font-family

list of font names

Define the font for an element, either as a specific font or as one of the generic fonts serif, sans-serif, cursive, fantasy, and monospace

9.3.3.1

(Netscape) (Internet Explorer)

font-size

xx-small | x-small | small | medium | large | x-large | xx-large | larger | smaller | length| percent

Define the font size

9.3.3.2

(Netscape) (Internet Explorer)

font-style

normal | italic | oblique

Define the style of the face, either normal or some type of slanted style

9.3.3.3

(Netscape) (Internet Explorer)

font-variant

normal | small-caps

Define a font to be in small caps

9.3.3.4

 

font-weight

normal | bold | bolder| lighter | number

Define the font weight. If a number is used, it must be a multiple of 100 between 100 and 900; 400 is normal, 700 is the same as the keyword bold.

9.3.3.5

(Netscape) (Internet Explorer)

height

length | auto

Define the height of an element

9.3.6.9

(Netscape)

letter-spacing

length | normal

Inserts additional space between text characters

9.3.5.1

 

line-height

length | number | percent| normal

Sets the distance between adjacent text baselines

9.3.5.2

(Netscape) (Internet Explorer)

list-style

 

Defines list-related styles using any of the values for list-style-image, list-style-position, and list-style-type

9.3.7.4

 

list-style-image

url | none

Define an image to be used as a list item's marker, in lieu of the value for list-style-type

9.3.7.1

 

list-style-position

inside | outside

Indents or extends (default) a list item's marker with respect to the item's content

9.3.7.2

 

list-style-type

circle | disc | square| decimal | lower-alpha | lower-roman| none | upper-alpha | upper-roman

Define a list item's marker for either unordered lists (circle, disc, or square) or for ordered lists (decimal, lower-alpha, lower-roman, none, upper-alpha, or upper-roman)

9.3.7.3

 

margin

length | percent | auto

Define all four of an element's margins

9.3.6.10

(Netscape) (Internet Explorer)

margin-bottom

length | percent | auto

Define the bottom margin of an element; default value is 0

9.3.6.10

(Netscape)

margin-left

length | percent | auto

Define the left margin of an element; default value is 0

9.3.6.10

(Netscape) (Internet Explorer)

margin-right

length | percent | auto

Define the right margin of an element; default value is 0

9.3.6.10

(Netscape) (Internet Explorer)

margin-top

length | percent | auto

Define the top margin of an element; default value is 0

9.3.6.10

(Netscape) (Internet Explorer)

padding

 

Define all four padding amounts around an element

9.3.6.4

 

padding-bottom

length | percent

Define the bottom padding of an element; default value is 0

9.3.6.4

(Netscape)

padding-left

length | percent

Define the left padding of an element; default value is 0

9.3.6.4

(Netscape)

padding-right

length | percent

Define the right padding of an element; default value is 0

9.3.6.4

(Netscape)

padding-top

length | percent

Define the top padding of an element; default value is 0

9.3.6.4

(Netscape)

text-align

center | justify | left | right

Set the text alignment style for an element

9.3.5.3

(Netscape) (Internet Explorer)

text-decoration

blink | line-through | none | overline | underline

Define any decoration for the text; values may be combined

9.3.5.4

(Netscape) (Internet Explorer)

text-indent

length | percent

Define the indentation of the first line of text in an element; default value is 0

9.3.5.5

(Netscape) (Internet Explorer)

text-transform

capitalize | lowercase | none | uppercase

Transform the text in the element accordingly

9.3.5.6

(Netscape)

vertical-align

percent | baseline | bottom | middle | sub | super | text-bottom | text-top | top

Set the vertical positioning of an element

9.3.5.7

 

word-spacing

length | normal

Insert additional space between words

9.3.5.8

 

white-space

normal | nowrap | pre

Define how whitespace within an element is handled

9.3.8.2

 

width

length | percent | auto

Define the width of an element

9.3.6.12

(Netscape)


Previous Home Next
HTML Tag Quick Reference Book Index The HTML 3.2 DTD

HTML: The Definitive Guide CGI Programming JavaScript: The Definitive Guide Programming Perl WebMaster in a Nutshell