CSS Tutorial
Appendix 2: Property References
This is a complete list of all CSS1 and CSS 2.1 properties. Many CSS3 properties have also been included, but some were excluded because they seem to me more subject to change since the specifications have not been finalized. Some proprietary properties have also been included because they are becoming more widely used.
Available property values are separated by a pipe "|". If a property (such as "font") can take more than one value as a CSS shortcut, those values will be separated by a double pipe "||".
Default properties are marked strong (bold in visual browsers). If no default is indicated it means that it varies across UAs. Emphasized values (in italics for visual browsers) represent value types that are to be replaced with actual values. An asterisk after a property name means that that property inherits its value by default. The property value "inherit", on the other hand, means that the value can be made to be inherited, if it does not inherit by default; or if it does inherit by default, have its inheritance strengthened. Notes and examples follow.
Examples:
The background-repeat property can take the values that follow the property listing. "repeat" is the default. Since there is no asterisk after the property "background", it does not inherit from its parent.
The letter-spacing property takes the literal values of "normal" and "inherit", but also a length, such as 9px. The asterisk indicates that it inherits its value from its parent.
The "background" property is a shortcut for several properties, namely, "background-color", " background-image", " background-repeat", " background-attachment", and "background-position", for example:
The single pipe before the "inherit" value means that you can alternatively use the "inherit" value instead of a property value.
Any unspecified property automatically inherits from its parent or takes a CSS-defined default. Again, that default is specified by the underlined value. See a CSS browser compatibility chart at Web Devout.
POSITIONING AND DISPLAY
DISPLAY
Notes: Currently most browsers only support some of these values. "compact" and "marker" were removed from the 2.1 specification.
"none" hides the element, so that it does not take up space, nor get iterated as generated content. Compare to visibility: hidden. "inline" is floating content without a line break. "block" creates a line break like a div element. "list-item" is like an item in an unordered list. "run-in" causes the element to appear as an inline element at the start of the block immediately following it. "inline-block" causes the element to generate a block element box that will be flowed with surrounding content as if it were a single inline box.
The following values probably have more use in the context of styling XML.
"table" is the outer container for all tables. It defines a rectangular block element that contains any number of row groups, rows, column groups, columns, and/or captions, all arranged in an irregular grid pattern. Any rendering objects other than these should be displayed outside the rectangular grid. Analogous to <table>.
"inline-table" is identical to a table element, except that it is treated as an inline replaced element in the context surrounding the "inline-table" element. "table-column-group" is a container for a number of table columns. This allows the designer to set presentation properties on a group of columns, for example by placing borders around a group of columns. Analogous to <colgroup>. "table-column" is a grouping of all cells in a particular vertical column. Analogous to <col>. "table-row-group" is a container for a number of table rows. This allows the designer to set presentation properties on a group of rows, for example by placing borders around a group of rows. Analogous to <tbody>. "table-header-group" is a special type of "table-row-group" that is always displayed at the top of the table, above all other rows and row-groups, but below any captions. Analogous to <thead>. "table-footer-group" is a special type of "table-row-group" that is always displayed at the bottom of the table, below all other rows and row-groups, but above any captions. Analogous to <tfoot>. "table-row" groups all cells in a particular horizontal row. Analogous to <tr>. "table-cell" is the rectangular object to be arranged in the table grid. Table cells are only allowed inside rows. Analogous to <td>. "table-caption" is a special type of table cell that appears as a row or column of its own in a table. Analogous to <caption>. "icon" is a CSS3-proposed value. The W3C says, "The element is replaced in its entirety by the resource referenced by its 'icon' property, and treated as a replaced element, visually formatted as an inline-block."
POSITION
TOP
RIGHT
BOTTOM
LEFT
Z-INDEX
OVERFLOW
OVERFLOW-X (CSS3)
(same as above for horizontal overflow)
OVERFLOW-Y (CSS3)
(same as above for vertical overflow)
OVERFLOW-STYLE (CSS3)
CLIP
Notes: Currently "rect" (rectangle) is the only shape.
VISIBILITY
FLOAT
Notes: mid-column is CSS3 proposed for columns.
CLEAR
FONT AND TEXT
FONT-STYLE *
FONT-VARIANT *
FONT-WEIGHT *
FONT-SIZE *
LINE-HEIGHT *
FONT:-FAMILY *
FONT *
Notes: There is a slash between font-size and line-height. If a font-family is comprised of more than one word, put it in quotes, e.g. p {font-family: "Trebuchet MS", Verdana;} Also, it is good to include a generic alternative in case the user does not have any of the fonts installed.
"caption" is used for captioned controls like buttons, drop-downs, etc. "icon" is used to label icons. "menu" is used in menus like dropdown menus and menu lists. "messagebox" is used in dialog boxes. "smallcaption" is used for labeling small controls. "statusbar" is used in window status bars, and so forth
FONT-SIZE-ADJUST * (CSS3)
Notes: There are problems with this property specification. It was removed in CSS2.1, and then restored in CSS3 with revisions.
FONT-STRETCH * (CSS3)
Notes: Removed from 2.1 spec, but may be reinstated in CSS3.
LETTER-SPACING *
WORD-SPACING *
TEXT-ALIGN *
Notes: Text-align can use a string for table elements only, to align on that string, for example, text-align: "." will align on a decimal point. This does not seem to have browser support. "start" and "end" are CSS3 proposed values. Default depends on UA and direction property.
TEXT-ALIGN-LAST * (CSS3)
Notes: This property describes how the last line of the inline content of a block is aligned when "text-align" is set to "justify".
TEXT-DECORATION *
TEXT-TRANSFORM *
TEXT-INDENT *
Notes: Default = "0". "hanging" is CSS3 and not supported.
VERTICAL-ALIGN
WHITE-SPACE *
WHITE-SPACE-COLLAPSE * (CSS3)
DIRECTION *
UNICODE-BIDI
TEXT-SHADOW (CSS3)
Notes: Support is minimal. Removed from 2.1 spec. An example might be {textshadow: -5px -5px purple, 10px 10px red;}.
TEXT-WRAP * (CSS3)
WORD-WRAP * (CSS3)
WRAP-OPTION * (CSS3)
WORD-BREAK * (CSS3)
HYPHENATE * (CSS3)
Notes: This replaces the proposed "word-break-inside" property, now withdrawn.
MIN-FONT-SIZE * (CSS3)
MAX-FONT-SIZE * (CSS3)
LINEFEED-TREATMENT * (CSS3)
ALL-SPACE-TREATMENT * (CSS3)
TEXT-OVERFLOW-MODE (CSS3)
TEXT-OVERFLOW-ELLIPSIS (CSS3)
Notes: Default value is "U+2026 (value of)".
TEXT-OVERFLOW (CSS3)
KERNING-MODE * (CSS3)
KERNING-PAIR-THRESHOLD * (CSS3)
DIMENSIONS
WIDTH
HEIGHT
MIN-WIDTH
Notes: Default is UA dependant. Not supported in IE6.
MAX-WIDTH
Notes: Not supported in IE6.
MIN-HEIGHT
Notes: Default = "0". Not supported in IE6.
MAX-HEIGHT
Notes: Not supported in IE6.
COLOR AND BACKGROUND
COLOR *
Notes: Default depends on UA, generally black. Examples: rgb(255,0,0) or rgb(100%,0%,0%) | #666 or #EFEFEF | red
BACKGROUND-COLOR
Examples: rgb(255,0,0) or rgb(100%,0%,0%) | #666 or #EFEFEF | red
BACKGROUND-IMAGE
BACKGROUND-REPEAT
BACKGROUND-ATTACHMENT
BACKGROUND-POSITION
Default is 0% 0%. With a value pair of '0% 0%', the upper left corner of the image is aligned with the upper left corner of the box's padding edge. A value pair of '100% 100%' places the lower right corner of the image in the lower right corner of padding area. With a value pair of '14% 84%', the point 14% across and 84% down the image is to be placed at the point 14% across and 84% down the padding area. With a value pair of '2cm 2cm', the upper left corner of the image is placed 2cm to the right and 2cm below the upper left corner of the padding area.
top left and left top = '0% 0%'. top, top center, and center top = '50% 0%'. right top and top right = '100% 0%'. left, left center, and center left = '0% 50%' center and center center = as '50% 50%'. right, right center, and center right = '100% 50%' bottom left and left bottom = '0% 100%' bottom, bottom center, and center bottom = '50% 100%'. bottom right and right bottom = '100% 100%'
BACKGROUND-BREAK (CSS3)
OUTLINE
COLUMNS
COLUMN-WIDTH (CSS3)
COLUMN-COUNT (CSS3)
COLUMN-GAP (CSS3)
COLUMN-RULE-WIDTH (CSS3)
COLUMN-RULE-STYLE (CSS3)
COLUMN-RULE-COLOR (CSS3)
Examples: rgb(255,0,0) or rgb(100%,0%,0%) | #666 or #EFEFEF | red
GENERATED CONTENT
CONTENT
COUNTER-RESET
COUNTER-INCREMENT
QUOTES *
Notes: Default depends on UA. Can use character, description, or entity number.
MARKER-OFFSET
Notes: Used in conjunction with ::before and ::after pseudo-elements display property's "marker" value. Removed in CSS3.
MISCELLANEOUS
CURSOR *
url example: cursor: url(mycursor.cur); "hand" is IE proprietary. Use "pointer".
APPEARANCE (CSS3)
RESIZE (CSS3)
KEY-EQUIVALENT (CSS3)
NAV-INDEX (CSS3)
NAV-UP (CSS3)
NAV-RIGHT (CSS3)
NAV-DOWN (CSS3)
NAV-LEFT (CSS3)
ICON (CSS3)
MARKS
Notes: No current support. Not in 2.1 spec.
ORPHANS *
Notes: 0 = off; 2 = on.
PAGE *
Notes: Not in 2.1 spec.
PAGE-BREAK-INSIDE *
PAGE-BREAK-AFTER
PAGE-BREAK-BEFORE
SIZE
Notes: Not in 2.1 spec.
WIDOWS *
Notes: 0 = off; 2 = on, and is default.
AURAL
AZIMUTH *
CUE (CSS3)
CUE-BEFORE (CSS3)
CUE-AFTER (CSS3)
ELEVATION * (CSS3)
PAUSE (CSS3)
PAUSE-BEFORE (CSS3)
PAUSE-AFTER (CSS3)
PITCH (CSS3)
PITCH-RANGE * (CSS3)
Notes: Default = "50".
PLAY-DURING (CSS3)
SPEAK * (CSS3)
SPEAK-HEADER * (CSS3)
SPEAK-NUMERAL * (CSS3)
SPEAK-PUNCTUATION * (CSS3)
STRESS * (CSS3)
Notes: Default = "50".
VOICE-RATE * (CSS3)
VOICE-FAMILY *
VOICE-VOLUME * (CSS3)
Tranformation Functions
Further Reading
- W3C CSS Validation Tool
- CSS 2.1 Specification
- CSS 3 Specifications (Current Work)
- CSS3.info: A lot of useful information and demos.
- Jonathan Snook: Tips, Tricks and Bookmarks on Web Development
- QuirksMode - for all your browser quirks featuring the Compatibility Master Table for browser support
- Floatutorial: A tutorial on floating and clearing