CSS Properties: A Comprehensive Reference
Property/Values | Description and notes |
---|---|
background any combination of the values for background-attachment, background-color,background-image, background-repeat, and/or background-position, or | for changing the background color and image of elements initial value depends on individual properties; not inherited; percentages allowed for background-position |
background-attachment either | for determining if and how background images should scroll initial value: |
background-color either a color, | for setting just the background color of an element initial value: |
background-image either a URL, | for setting just the background image of an element initial value: |
background-position either one or two percentages or lengths (or one percentage and one length) or one of | for setting the physical position of a specified background image initial value: |
background-repeat one of | for determining how and if background images should be tiled initial value: |
border any combination of the values of border-width, border-style, and/or a color, or | for defining all aspects of a border on all sides of an element initial value depends on individual properties; not inherited |
border-color from one to four colors, | for setting only the color of the border on one or more sides of an element initial value: the element’s |
border-spacing either one or two lengths or | for specifying the amount of space between borders in a table initial value: 0; may be applied only to table elements; inherited |
border-style one to four of the following values: | for setting only the style of a border on one or more sides of an element initial value: |
border-top, border-right, border-bottom, border-left any combination of a single value each for border-width, border-style, and/or a color, or use | for defining all three border properties at once on only one side of an element initial value depends on individual values; not inherited |
border-top-color, border-right-color, border-bottom-color, border-left-color one color or | for defining just the border’s color on only one side of an element initial value: the value of the color property; not inherited |
border-top-style, border-right-style, border-bottom-style, border-left-style one of | for defining just the border’s style on only one side of an element initial value: |
border-top-width, border-right-width, border-bottom-width, border-left-width one of | for defining just the border’s width on only one side of an element initial value: |
border-width one to four of the following values: | for defining the border’s width on one or more sides of an element initial value: |
clear one of | for keeping elements from floating on one or both sides of an element initial value: |
bottom either a percentage, length, | for setting the distance that an element should be offset from its parent element’s bottom edge initial value: |
color a color or | for setting the foreground color of an element initial value: parent’s color, some colors are set by browser; inherited |
cursor one of | for setting the cursor’s shape initial value: |
display one of | for determining how and if an element should be displayed initial value: |
float one of | for determining on which side of an element other elements are permitted to float initial value: |
font if desired, any combination of the values for font-style, font-variant andfont-weight followed by the required font-size, an optional value for line-height and the also required font-family, or use | for setting at least the font family and size, and optionally the style, variant, weight, and line-height of text initial value depends on individual properties; inherited; percentages allowed for values of font-size and line-height |
font-family one or more quotation mark-enclosed font names followed by an optional generic font name, or use | for choosing the font family for text initial value: depends on browser; inherited |
font-size an absolute size, a relative size, a length, a percentage, or | for setting the size of text initial value: |
font-style either | for making text italic initial value: |
font-variant either | for setting text in small caps initial value: |
font-weight either | for applying, removing, and adjusting bold formatting initial value: |
height either a length, percentage, | for setting the height of an element initial value: |
left either a length, percentage, | for setting the distance that an element should be offset from its parent element’s left edge initial value: |
letter-spacing either | for setting the amount of space between letters initial value: |
line-height either | for setting the amount of space between lines of text initial value: |
list-style any combination of the values for list-style-type, list-style-position and/orlist-style-image, or use | for setting a list’s marker (regular or custom) and its position initial value depends on initial values of individual elements; may only be applied to list elements; inherited |
list-style-image either a URL, | for designating a custom marker for a list initial value: |
list-style-position either | for determining the position of a list’s marker initial value: |
list-style-type either | for setting a list’s marker initial value: |
margin one to four of the following: | for setting the amount of space between one or more sides of an element’s border and its parent element initial value depends on browser and on value of |
margin-top, margin-right, margin-bottom, margin-left either a length, percentage, | for setting the amount of space between only one side of an element’s border and its parent element initial value: |
marks either | for printing crop marks and/or cross marks initial value: none; can only be applied in a |
max-height, max-width either a length, percentage, | for setting the maximum height and/or width of an element, respectively initial value: |
min-height, min-width either a length, percentage, or | for setting the minimum height and/or width of an element, respectively initial value: |
orphans either an integer or | for specifying how many lines of an element may appear alone at the bottom of a page initial value: 2; may only be applied to block-level elements; inherited |
overflow either | for determining where extra content should go if it does not fit in the element’s content area initial value: |
padding one to four lengths or percentages, or | for specifying the distance between one or more sides of an element’s content area and its border initial value depends on browser: not inherited; percentages refer to width of containing block |
padding-top, padding-right, padding-bottom, padding-left either a length, percentage, or | for specifying the distance between one side of an element’s content area and its border initial value: |
page either a page area’s name or | for specifying on which kind of page an element should be printed initial value: |
page-break-after, page-break-before either | for specifying when page breaks should or should not occur initial value: |
page-break-inside either | for keeping page breaks from dividing an element across pages initial value: |
position either | for determining how an element should be positioned with respect to the document’s flow initial value: |
right either a length, percentage, | for setting the distance that an element should be offset from its parent element’s right edge initial value: |
size either individual lengths for width and height, a single value for both width and height, | for determining the size of the printing area in a defined page initial value: |
table-display one of | for choosing the algorithm that should be used to determine the widths of cells initial value: auto; not inherited |
text-align one of | for aligning text initial value depends on browser and writing direction; may only be applied to block-level elements; inherited |
text-decoration any combination of | for decorating text (mostly with lines) initial value: |
text-indent either a length, percentage, or | for setting the amount of space the first line of a paragraph should be indented initial value: |
text-transform either | for setting the capitalization of an element’s text initial value: |
top either a length, percentage, | for setting the distance that an element should be offset from its parent element’s top edge initial value: |
vertical-align either | for aligning elements vertically initial value: |
visibility either | for hiding elements without taking them out of the document’s flow initial value: |
white-space either | for specifying how white space should be treated initial value: |
widows either an integer or | for specifying how many lines of an element may appear alone at the top of a page initial value: 2; may only be applied to block-level elements; inherited |
width either a length, percentage, | for setting the width of an element initial value: |
word-spacing either | for setting the distance between words initial value: |
z-index either | for setting the depth of an element with respect to overlapping elements initial value: |