|
|
|
|
HTML & XHTML: The Definitive Guide, 4th EditionBy Chuck Musciano & Bill Kennedy4th Edition August 2000 0-596-00026-X, Order Number: 026X 677 pages, $34.95 |
Appendix C
Cascading Style Sheet Properties Quick ReferenceIn 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).
As in other sections of this book, we use the Netscape and Internet Explorer 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 G, 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
255or100%indicate that the corresponding color component is at its brightest; values of0or0%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
emandexrefer to the overall height of the font and to the height of the letter "x", respectively. The unit identifierpxis equal to a single pixel on the display device. The unit identifiersin,cm,mm,pt, andpcrefer 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 underlined.
background
Composite property for the
background-attachment,background-color,background-image,background-position, andbackground-repeatproperties; value is any of these properties' values, in any order8.4.4.6
![]()
![]()
background-
attachment
scroll|fixedDetermines if the background image is fixed in the window or scrolls as the document scrolls
8.4.4.1
![]()
background-color
color | transparent
Sets the background color of an element
8.4.4.2
![]()
![]()
background-image
url | none
Sets the background image of an element
8.4.4.3
![]()
![]()
background-position
percent | length |
top|center|bottom|left|rightSets 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%8.4.4.4
![]()
background-repeat
repeat |
repeat-x|repeat-y|
no-repeatDetermines how the background image is repeated (tiled) across an element
8.4.4.5
![]()
![]()
border
Sets all four borders on an element; value is one or more of a color, a value for
border-width, and a value forborder-style8.4.4.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 forborder-style8.4.4.6
![]()
border-bottom-width
length |
thin| medium |thickSets the thickness of an element's bottom border
8.4.6.4
![]()
![]()
border-color
color
Sets the color of all four of an element's borders; default is the color of the element
8.4.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 forborder-style8.4.6.6
![]()
border-left-width
length |
thin| medium |thickSets the thickness of an element's left border
8.4.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 forborder-style8.4.6.6
![]()
border-right-width
length |
thin| medium |thickSets the thickness of an element's right border
8.4.6.4
![]()
![]()
border-style
dashed|dotted|double|groove|inset| none |outset|ridge|solidSets the style of all four of an element's borders
8.4.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 forborder-style8.4.6.6
![]()
border-top-width
length |
thin| medium |thickSets the thickness of an element's top border
8.4.6.4
![]()
![]()
border-width
length |
thin| medium |thickSets the thickness of all four of an element's borders
8.4.6.4
![]()
![]()
clear
both|left| none |rightSets which margins of an element must not be adjacent to a floating element; the element will be moved down until that margin is clear
8.4.6.7
![]()
![]()
color
color
Sets the color of an element
8.4.4.7
![]()
![]()
display
block |
inline|list-item|noneControls how an element is displayed
8.4.8.1
![]()
![]()
float
left| none |rightDetermines if an element will float to the left or right, allowing text to wrap around it, or be displayed inline (using
none)8.4.6.8
![]()
![]()
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, andfont-family, in that order8.4.3.8
![]()
![]()
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, andmonospace8.4.3.1
![]()
![]()
font-size
xx-small|x-small|small| medium |large|x-large|xx-large|larger|smaller| length | percentDefines the font size
8.4.3.2
![]()
![]()
font-size-adjust
none| ratioAdjusts the current fon't aspect ratio
8.4.3.4
font-stretch
wider | normal | narrower | ultra-condensed | extra-condensed | condensed | semi-condensed | semi-expanded | expanded | extra-expanded | ultra-expandedDetermines the amount to stretch the current font
8.4.3.3
font-style
normal |
italic|obliqueDefines the style of the face, either normal or some type of slanted style
8.4.3.5
![]()
![]()
font-variant
normal |
small-capsDefines a font to be in small caps
8.4.3.6
![]()
font-weight
normal |
bold|bolder|lighter| numberDefines 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.8.4.3.7
![]()
![]()
height
length | auto
Defines the height of an element
8.4.6.9
![]()
![]()
letter-spacing
length | normal
Inserts additional space between text characters
8.4.5.1
![]()
![]()
line-height
length | number | percent | normal
Sets the distance between adjacent text baselines
8.4.5.2
![]()
![]()
list-style
Defines list-related styles using any of the values for
list-style-image,list-style-position, andlist-style-type8.4.7.4
![]()
![]()
list-style-image
url | none
Defines an image to be used as a list item's marker, in lieu of the value for
list-style-type8.4.7.1
![]()
![]()
list-style-position
inside| outsideIndents or extends (default) a list item's marker with respect to the item's content
8.4.7.2
list-style-type
circle| disc |square|decimal|lower-alpha|lower-roman|none|upper-alpha|upper-romanDefines a list item's marker for either unordered lists (
circle,disc, orsquare) or for ordered lists (decimal,lower-alpha,lower-roman,none,upper-alpha, orupper-roman)8.4.7.3
![]()
![]()
margin
length | percent |
autoDefines all four of an element's margins
8.4.6.10
![]()
![]()
margin-bottom
length | percent |
autoDefines the bottom margin of an element; default value is 0
8.4.6.10
![]()
![]()
margin-left
length | percent |
autoDefines the left margin of an element; default value is 0
8.4.6.10
![]()
![]()
margin-right
length | percent |
autoDefines the right margin of an element; default value is 0
8.4.6.10
![]()
![]()
margin-top
length | percent |
autoDefines the top margin of an element; default value is 0
8.4.6.10
![]()
![]()
padding
Defines all four padding amounts around an element
8.4.6.11
![]()
![]()
padding-bottom
length | percent
Defines the bottom padding of an element; default value is 0
8.4.6.11
![]()
![]()
padding-left
length | percent
Defines the left padding of an element; default value is 0
8.4.6.11
![]()
![]()
padding-right
length | percent
Defines the right padding of an element; default value is 0
8.4.6.11
![]()
![]()
padding-top
length | percent
Defines the top padding of an element; default value is 0
8.4.6.11
![]()
![]()
text-align
center|justify|left|rightSet the text alignment style for an element
8.4.5.3
![]()
![]()
text-decoration
blink|line-through| none |overline|underlineDefines any decoration for the text; values may be combined
8.4.5.4
![]()
![]()
text-indent
length | percent
Defines the indentation of the first line of text in an element; default value is 0
8.4.5.5
![]()
![]()
text-shadow
See textCreates text drop shadows of varying colors and offsets
8.4.5.6
nbsp;
text-transform
capitalize|lowercase| none |uppercaseTransforms the text in the element accordingly
8.4.5.7
![]()
![]()
vertical-align
percent |
baseline|bottom|middle|sub|super|text-bottom|text-top|topSets the vertical positioning of an element
8.4.5.8
![]()
![]()
word-spacing
length | normal
Inserts additional space between words
8.4.5.9
![]()
white-space
normal |
nowrap|preDefines how whitespace within an element is handled
8.4.8.2
![]()
width
length | percent | auto
Defines the width of an element
8.4.6.12
![]()
![]()
Back to: HTML & XHTML: The Definitive Guide, 4th Edition
© 2001, O'Reilly & Associates, Inc.
webmaster@oreilly.com