9.4. CSS ReferenceThe remainder of this chapter lists 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). All browsers do not implement all properties fully, and some simply do not work correctly. As in the HTML reference, we use the Netscape and Internet Explorer icons to show which browser supports that property. Properties with no icons are not currently supported by these browsers. The following list includes each property's possible values, defined as either an explicit keyword (shown in constant width) or as one of these values:
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. The standard defines a default value for most properties. The default property is listed in the top syntax line for the property. Additional allowed values are listed beneath each description.
background:list Composite property for the background-attachment, background-color, background-image, background-position, and background-repeat properties; list is any of these properties' values, in any order.
background-attachment: scroll Determines if the background image is fixed in the window or scrolls as the document scrolls. Accepted values: fixed, scroll
background-color: transparent Sets the background color of an element. Accepted values: color, transparent.
background-image: none Sets the background image of an element. Accepted values: url, transparent.
background-position: percent 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%. Accepted values: length, percent, top, center, bottom, left, right.
background-repeat: repeat Determines how the background image is repeated (tiled) across an element. Accepted values: repeat, repeat-x, repeat-y, no-repeat.
border: list 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.
border-bottom: list 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.
border-bottom-width: medium Sets the thickness of an element's bottom border. Accepted values: medium, length, thin, thick.
border-color: color Sets the color of all four of an element's borders; default is the color of the element.
border-left: list 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.
border-left-width: medium Sets the thickness of an element's left border. Accepted values: length, medium, thin, thick.
border-right: list 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.
border-right-width: medium Sets the thickness of an element's right border. Accepted values: length, medium, thin, thick.
border-style: none Sets the style of all four of an element's borders. Accepted values: none, dashed, dotted, double, groove, inset, outset, ridge, solid.
border-top: list 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.
border-top-width: medium Sets the thickness of an element's top border. Accepted values: length, medium, thin, thick.
border-width: medium Sets the thickness of all four of an element's borders. Accepted values: length, medium, thin, thick.
clear: none 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. Accepted values: none, both, left, right.
display: block Controls how an element is displayed. Accepted values: block, inline, list-item, none.
float: none Determines if an element floats to the left or right, allowing text to wrap around it, or be displayed inline (using none). Accepted values: left, right, none.
font: list 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.
font-family: list of font names Defines the font for an element, either as a specific font or as one of the generic fonts serif, sans-serif, cursive, fantasy, or monospace.
font-size: size Defines the font size. Accepted values: length, percent, xx-small, x-small, small, medium, large, x-large, xx-large, larger, smaller.
font-style: normal Defines the style of the face, either normal or some type of slanted style. Accepted values: italic, oblique, normal.
font-variant: normal Defines a font to be in small caps. Accepted values: smallcaps, normal.
font-weight: normal Defines 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. Accepted values: bold, bolder, lighter, number, normal.
letter-spacing: normal Inserts additional space between text characters. Accepted values: length, normal.
line-height: normal Sets the distance between adjacent text baselines. Accepted values: length, number, percent, normal.
list-style: list Defines list-related styles using any of the values for list-style-image, list-style-position, and list-style-type.
list-style-image: none Defines an image to be used as a list item's marker, in lieu of the value for list-style-type. Accepted values: url, none.
list-style-position: outside Indents or extends (default) a list item's marker with respect to the item's content. Accepted values: inside, outside.
list-style-type: disc Defines a list item's marker for either unordered lists (circle, disc, or square) or ordered lists (the rest). Accepted values: circle, square, decimal, disc, lower-alpha, lower-roman, none, upper-alpha, upper-roman.
margin: length Defines all four of an element's margins. Accepted values: length, percent, auto.
margin-bottom: length Defines the bottom margin of an element; default value is 0. Accepted values: length, percent, auto.
margin-left: length Defines the left margin of an element; default value is 0. Accepted values: length, percent, auto.
margin-right: length Defines the right margin of an element; default value is 0. Accepted values: length, percent, auto.
margin-top: length Defines the top margin of an element; default value is 0. Accepted values: length, percent, auto.
padding-bottom: length Defines the bottom padding of an element; default value is 0. Accepted values: length, percent.
padding-left: length Defines the left padding of an element; default value is 0. Accepted values: length, percent.
padding-right: length Defines the right padding of an element; default value is 0. Accepted values: length, percent.
padding-top: length Defines the top padding of an element; default value is 0. Accepted values: length, percent.
text-align: style Sets the text alignment style for an element. The default value is dependent on the element. Accepted values: center, justify, left, right.
text-decoration: none Defines any decoration for the text; values may be combined.Accepted values: blink, line-through, none, overline, underline.
text-indent: length Defines the indentation of the first line of text in an element; default value is 0. Accepted values: length, percent.
text-transform: none Transforms the text in the element accordingly. Accepted values: capitalize, lowercase, none, uppercase.
vertical-align: position Sets the vertical positioning of an element. The default setting is dependent on the element. Accepted values: percent, baseline, bottom, middle, sub, super, text-bottom, text-top, top.
word-spacing: normal Inserts additional space between words. Accepted values: length, normal.
white-space: normal Defines how whitespace within an element is handled. Accepted values: normal, nowrap, pre. Copyright © 2003 O'Reilly & Associates. All rights reserved. |
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|