CSS Property Reference
The index below contains an alphabetical listing of some of the more widely used CSS properties. We have only included properties that currently (as of March 2019) have full "Recommendation" status, and that apply to visual media. A full list of CSS properties, including both standard and proposed properties, can be found here. Click on an item in the table for details.
Index
align-content
align-items
align-self
background
background-attachment
background-color
background-image
background-position
background-repeat
border
border-bottom
border-bottom-color
border-bottom-style
border-bottom-width
border-collapse
border-color
border-left
border-left-color
border-left-style
border-left-width
border-right
border-right-color
border-right-style
border-right-width
border-spacing
border-style
border-top
border-top-color
border-top-style
border-top-width
border-width
bottom
box-sizing
caption-side
clear
color
display
flex
flex-basis
flex-direction
flex-flow
flex-grow
flex-shrink
flex-wrap
float
font
font-family
font-size
font-style
font-variant
font-weight
height
justify-content
left
letter-spacing
line-height
list-style
list-style-image
list-style-position
list-style-type
margin
margin-bottom
margin-left
margin-right
margin-top
max-height
max-width
min-height
min-width
opacity
order
outline
outline-color
outline-offset
outline-style
outline-width
overflow
padding
padding-bottom
padding-left
padding-right
padding-top
page-break-after
page-break-before
page-break-inside
position
right
text-align
text-decoration
text-indent
text-transform
top
vertical-align
visibility
white-space
width
word-spacing
z-index
Value: | flex-start | flex-end | center | space-between | space-around | stretch |
---|---|
Initial: | stretch |
Applies to: | Multi-line flex containers |
Inherited: | No |
Percentages: | N/A |
Media: | Visual |
Computed value: | Specified keyword |
Description: | Aligns a flex container's lines within the flex container when there is extra space in the cross-axis (has no effect on a single-line flex container). Values have the following meanings:
|
Value: | flex-start | flex-end | center | baseline | stretch |
---|---|
Initial: | stretch |
Applies to: | Flex containers |
Inherited: | No |
Percentages: | N/A |
Media: | Visual |
Computed value: | Specified keyword |
Description: | Sets the default cross axis alignment for all flex items in a flex container. Values have the following meanings:
|
Value: | auto | flex-start | flex-end | center | baseline | stretch |
---|---|
Initial: | auto |
Applies to: | Flex items |
Inherited: | No |
Percentages: | N/A |
Media: | Visual |
Computed value: | Specified keyword |
Description: | Allows the default cross axis alignment to be overridden for an individual flex item. Values have the following meanings:
|
Value: | [<'background-color'> || <'background-image'> || <'background-repeat'> || <'background-attachment'> || <'background-position'>] | inherit |
---|---|
Initial: | See individual properties |
Applies to: | All elements |
Inherited: | No |
Percentages: | Allowed on background-position |
Media: | Visual |
Computed value: | See individual properties |
Description: | A shorthand property for setting individual background properties at the same place in the style sheet. |
Value: | scroll | fixed | inherit |
---|---|
Initial: | scroll |
Applies to: | All elements |
Inherited: | No |
Percentages: | N/A |
Media: | Visual |
Computed value: | As specified |
Description: | If a background image is specified, specifies whether it is fixed with regard to the viewport (fixed) or scrolls along with the containing block (scroll). |
Value: | <color> | transparent | inherit |
---|---|
Initial: | transparent |
Applies to: | All elements |
Inherited: | No |
Percentages: | N/A |
Media: | Visual |
Computed value: | As specified |
Description: | Sets the background colour of an element, either a <color> value or the keyword transparent, to make the underlying colours shine through. |
Value: | <uri> | none | inherit |
---|---|
Initial: | None |
Applies to: | All elements |
Inherited: | No |
Percentages: | N/A |
Media: | Visual |
Computed value: | Absolute URI or none |
Description: | Sets the background image of an element. Authors should also specify a background colour to be used when the image is unavailable. The image is rendered on top of the background colour, which will be visible in the transparent parts of the image. |
Value: | [ [ <percentage> | <length> | left | center | right ] [ <percentage> | <length> | top | center | bottom ]? ] | [ [ left | center | right ] || [ top | center | bottom ] ] | inherit |
---|---|
Initial: | 0% 0% |
Applies to: | All elements |
Inherited: | No |
Percentages: | Refer to the size of the box itself |
Media: | Visual |
Computed value: | For <length> the absolute value, otherwise a percentage |
Description: | If a background image has been specified, this property specifies its initial position. If only one value is specified, the second value is assumed to be 'center'. If at least one value is not a keyword, then the first value represents the horizontal position and the second represents the vertical position. Negative <percentage> and <length> values are allowed. Values have the following meanings:
|
Value: | repeat | repeat-x | repeat-y | no-repeat | inherit |
---|---|
Initial: | repeat |
Applies to: | All elements |
Inherited: | No |
Percentages: | N/A |
Media: | Visual |
Computed value: | As specified |
Description: | If a background image is specified, specifies whether the image is repeated (tiled), and how (all tiling covers the content, padding and border areas of a box):
|
Value: | [ <border-width> || <border-style> || <'border-color'> ] | inherit |
---|---|
Initial: | See individual properties |
Applies to: | All elements |
Inherited: | No |
Percentages: | N/A |
Media: | Visual |
Computed value: | See individual properties |
Description: | A shorthand property for setting the same width, colour, and style for all four borders of a box (cannot set different values on the four borders - to do so, one or more of the other border properties must be used). |
Value: | [ <border-width> || <border-style> || <'border-bottom-color'> ] | inherit |
---|---|
Initial: | See individual properties |
Applies to: | All elements |
Inherited: | No |
Percentages: | N/A |
Media: | Visual |
Computed value: | See individual properties |
Description: | A shorthand property for setting the width, style, and color of the bottom border of a box. |
Value: | <color> | transparent | inherit |
---|---|
Initial: | The value of the 'color' property |
Applies to: | All elements |
Inherited: | No |
Percentages: | N/A |
Media: | Visual |
Computed value: | When taken from the 'color' property, the computed value of 'color'; otherwise, as specified |
Description: | Specifies the colour of the bottom border. |
Value: | <border-style> | inherit |
---|---|
Initial: | none |
Applies to: | All elements |
Inherited: | No |
Percentages: | N/A |
Media: | Visual |
Computed value: | As specified |
Description: | Sets the style of the bottom border:
|
Value: | <border-width> | inherit |
---|---|
Initial: | medium |
Applies to: | All elements |
Inherited: | No |
Percentages: | N/A |
Media: | Visual |
Computed value: | Absolute length; '0' if the border style is 'none' or 'hidden' |
Description: | Sets the width of the bottom border of a box:
|
Value: | collapse | separate | inherit |
---|---|
Initial: | separate |
Applies to: | 'table' and 'inline-table' elements |
Inherited: | Yes |
Percentages: | N/A |
Media: | Visual |
Computed value: | As specified |
Description: | Selects a table's border model. The value 'separate' selects the separated borders border model. The value 'collapse' selects the collapsing borders model. |
Value: | [ <color> | transparent ]{1,4} | inherit |
---|---|
Initial: | See individual properties |
Applies to: | All elements |
Inherited: | No |
Percentages: | N/A |
Media: | Visual |
Computed value: | See individual properties |
Description: | Sets the colour of the four borders. |
Value: | [ <border-width> || <border-style> || <'border-left-color'> ] | inherit |
---|---|
Initial: | See individual properties |
Applies to: | All elements |
Inherited: | No |
Percentages: | N/A |
Media: | Visual |
Computed value: | See individual properties |
Description: | A shorthand property for setting the width, style, and color of the left border of a box. |
Value: | <color> | transparent | inherit |
---|---|
Initial: | The value of the 'color' property |
Applies to: | All elements |
Inherited: | No |
Percentages: | N/A |
Media: | Visual |
Computed value: | When taken from the 'color' property, the computed value of 'color'; otherwise, as specified |
Description: | Specifies the colour of the left border. |
Value: | <border-style> | inherit |
---|---|
Initial: | none |
Applies to: | All elements |
Inherited: | No |
Percentages: | N/A |
Media: | Visual |
Computed value: | As specified |
Description: | Sets the style of the left border:
|
Value: | <border-width> | inherit |
---|---|
Initial: | medium |
Applies to: | All elements |
Inherited: | No |
Percentages: | N/A |
Media: | Visual |
Computed value: | Absolute length; '0' if the border style is 'none' or 'hidden' |
Description: | Sets the width of the left border of a box:
|
Value: | [ <border-width> || <border-style> || <'border-right-color'> ] | inherit |
---|---|
Initial: | See individual properties |
Applies to: | All elements |
Inherited: | No |
Percentages: | N/A |
Media: | Visual |
Computed value: | See individual properties |
Description: | A shorthand property for setting the width, style, and color of the right border of a box. |
Value: | <color> | transparent | inherit |
---|---|
Initial: | The value of the 'color' property |
Applies to: | All elements |
Inherited: | No |
Percentages: | N/A |
Media: | Visual |
Computed value: | When taken from the 'color' property, the computed value of 'color'; otherwise, as specified |
Description: | Specifies the colour of the right border. |
Value: | <border-style> | inherit |
---|---|
Initial: | none |
Applies to: | All elements |
Inherited: | No |
Percentages: | N/A |
Media: | Visual |
Computed value: | As specified |
Description: | Sets the style of the right border:
|
Value: | <border-width> | inherit |
---|---|
Initial: | medium |
Applies to: | All elements |
Inherited: | No |
Percentages: | N/A |
Media: | Visual |
Computed value: | Absolute length; '0' if the border style is 'none' or 'hidden' |
Description: | Sets the width of the right border of a box:
|
Value: | <length> <length>? | inherit |
---|---|
Initial: | 0 |
Applies to: | 'table' and 'inline-table' elements |
Inherited: | Yes |
Percentages: | N/A |
Media: | Visual |
Computed value: | Two absolute lengths |
Description: | The lengths specify the distance that separates adjoining cell borders. If one length is specified, it gives both the horizontal and vertical spacing. If two are specified, the first gives the horizontal spacing and the second the vertical spacing. Lengths may not be negative. |
Value: | <border-style>{1,4} | inherit |
---|---|
Initial: | See individual properties |
Applies to: | All elements |
Inherited: | No |
Percentages: | N/A |
Media: | Visual |
Computed value: | See individual properties |
Description: | A shorthand property for setting 'border-top-style', 'border-right- style', 'border-bottom-style', and 'border-left-style'at the same place in the style sheet:
|
Value: | [ <border-width> || <border-style> || <'border-top-color'> ] | inherit |
---|---|
Initial: | See individual properties |
Applies to: | All elements |
Inherited: | No |
Percentages: | N/A |
Media: | Visual |
Computed value: | See individual properties |
Description: | A shorthand property for setting the width, style, and colour of the top border of a box. |
Value: | <color> | transparent | inherit |
---|---|
Initial: | The value of the color property |
Applies to: | All elements |
Inherited: | No |
Percentages: | N/A |
Media: | Visual |
Computed value: | When taken from the color property, the computed value of color; otherwise, as specified |
Description: | Specifies the colour of the top border. |
Value: | <border-style> | inherit |
---|---|
Initial: | none |
Applies to: | All elements |
Inherited: | No |
Percentages: | N/A |
Media: | Visual |
Computed value: | As specified |
Description: | Sets the style of the top border:
|
Value: | <border-width> | inherit |
---|---|
Initial: | medium |
Applies to: | All elements |
Inherited: | No |
Percentages: | N/A |
Media: | Visual |
Computed value: | Absolute length; '0' if the border style is 'none' or 'hidden' |
Description: | Sets the width of the top border of a box:
|
Value: | <border-width>{1,4} | inherit |
---|---|
Initial: | See individual properties |
Applies to: | All elements |
Inherited: | No |
Percentages: | N/A |
Media: | Visual |
Computed value: | See individual properties |
Description: | A shorthand property for setting 'border-top-width', 'border-right-width', 'border-bottom-width', and 'border-left-width' at the same place in the style sheet. If there is only one component value, it applies to all sides. If there are two values, the top and bottom borders are set to the first value and the right and left are set to the second. If there are three values, the top is set to the first value, the left and right are set to the second, and the bottom is set to the third. If there are four values, they apply to the top, right, bottom, and left, respectively. |
Value: | <length> | <percentage> | auto | inherit |
---|---|
Initial: | auto |
Applies to: | Positioned elements |
Inherited: | No |
Percentages: | Refer to height of containing block |
Media: | Visual |
Computed value: | If specified as a length, the corresponding absolute length; if specified as a percentage, the specified value; otherwise, 'auto'. |
Description: | Specifies how far an absolutely positioned box's bottom margin edge is offset above the bottom of the box's containing block. For relatively positioned boxes, the offset is with respect to the bottom edge of the box itself. Setting this property on non-positioned elements has no effect. |
Value: | content-box | border-box |
---|---|
Initial: | content-box |
Applies to: | All elements that accept width or height |
Inherited: | No |
Percentages: | N/A |
Media: | Visual |
Computed value: | Specified value |
Description: | Specifies how the width and height of an element are calculated, i.e. whether or not they include padding and borders. |
Value: | top | bottom | inherit |
---|---|
Initial: | top |
Applies to: | 'table-caption' elements |
Inherited: | Yes |
Percentages: | N/A |
Media: | Visual |
Computed value: | As specified |
Description: | Specifies the position of the caption box with respect to the table box ('top' positions the caption box above the table box, 'bottom' positions the caption box below the table box). |
Value: | none | left | right | both | inherit |
---|---|
Initial: | none |
Applies to: | Block-level elements |
Inherited: | No |
Percentages: | N/A |
Media: | Visual |
Computed value: | As specified |
Description: | Indicates which sides of an element's box(es) may not be adjacent to an earlier floating box (does not consider floats inside the element itself or in other block formatting contexts). |
Value: | <color> | inherit |
---|---|
Initial: | Depends on user agent |
Applies to: | All elements |
Inherited: | Yes |
Percentages: | N/A |
Media: | Visual |
Computed value: | As specified |
Description: | Describes the foreground colour of an element's text content. |
Value: | inline | block | list-item | inline-block | table | inline-table | table-row-group | table-header-group | table-footer-group | table-row | table-column-group | table-column | table-cell | table-caption | none | inherit |
---|---|
Initial: | inline |
Applies to: | All elements |
Inherited: | No |
Percentages: | N/A |
Media: | All |
Computed value: | As specified, except for positioned and floating elements |
Description: | Specifies the display behaviour (the type of rendering box) of an element:
|
Value: | none | [ <'flex-grow'> <'flex-shrink'>? || <'flex-basis'> ] |
---|---|
Initial: | 0 1 auto |
Applies to: | Flex items |
Inherited: | No |
Percentages: | See individual properties |
Media: | Visual |
Computed value: | See individual properties |
Description: | A shorthand property that sets the components of a flexible length: <'flex-grow'> is a number that sets the value of the flex-grow property that specifies the flex grow factor (i.e. how much the item will grow relative to the rest of the flex items in the flex container when positive free space is distributed). When omitted it is set to "1". <'flex-shrink'> is a number that sets the value of the flex-shrink property that specifies the flex shrink factor (i.e. how much the item will shrink relative to the rest of the flex items in the flex container when negative free space is distributed). When omitted it is set to "1". <'flex-basis'> sets the value of the flex-basis property that specifies the initial main size of the flex item before free space is distributed according to the flex factors. It accepts the same values as the width and height properties (except that auto is treated differently), plus the content keyword:
The flex property can also take the following keyword values:
|
Value: | content | <'width'> |
---|---|
Initial: | auto |
Applies to: | Flex items |
Inherited: | No |
Percentages: | Relative to the flex container's inner main size |
Media: | Visual |
Computed value: | Specified keyword or a computed <length-percentage> value |
Description: | Sets the flex basis (the initial main size of the flex item). It accepts the same values as the width and height property, plus content. Note: W3C recommends that authors control flexibility using the flex shorthand property rather than with flex-basis directly. |
Value: | row | row-reverse | column | column-reverse |
---|---|
Initial: | row |
Applies to: | Flex containers |
Inherited: | No |
Percentages: | N/A |
Media: | Visual |
Computed value: | Specified keyword |
Description: | Specifies how flex items are placed in the flex container (i.e. the direction in which flex items are laid out) by setting the direction of the flex container's main axis. The flex-direction property can take the following values:
|
Value: | <'flex-direction'> || <'flex-wrap'> |
---|---|
Initial: | See individual properties |
Applies to: | Flex containers |
Inherited: | See individual properties |
Percentages: | See individual properties |
Media: | Visual |
Computed value: | See individual properties |
Description: | A shorthand for setting the flex-direction and flex-wrap properties, which together define the flex container's main and cross axes. |
Value: | <number> |
---|---|
Initial: | 0 |
Applies to: | Flex items |
Inherited: | No |
Percentages: | N/A |
Media: | Visual |
Computed value: | Specified number |
Description: | Sets the flex grow factor to <number>. Negative numbers are invalid. Note: W3C recommends that authors control flexibility using the flex shorthand property rather than with flex-grow directly. |
Value: | <number> |
---|---|
Initial: | 1 |
Applies to: | Flex items |
Inherited: | No |
Percentages: | N/A |
Media: | Visual |
Computed value: | Specified number |
Description: | Sets the flex shrink factor to <number>. Negative numbers are invalid. Note: W3C recommends that authors control flexibility using the flex shorthand property rather than with flex-shrink directly. |
Value: | nowrap | wrap | wrap-reverse |
---|---|
Initial: | nowrap |
Applies to: | Flex containers |
Inherited: | No |
Percentages: | N/A |
Media: | Visual |
Computed value: | Specified keyword |
Description: | Controls whether the flex container is single-line or multi-line, and the direction in which new lines are stacked (i.e. the direction of the cross-axis). The flex-wrap property can take the following values:
|
Value: | left | right | none | inherit |
---|---|
Initial: | none |
Applies to: | All elements (but see note in Description: re absolutely positioned elements) |
Inherited: | No |
Percentages: | N/A |
Media: | Visual |
Computed value: | As specified |
Description: | Specifies whether a box should float to the left, right, or not at all. May be set for any element, but only applies to elements that generate boxes that are not absolutely positioned. If a box is floated left, content flows on the right side of the box, starting at the top (subject to the 'clear' property). If a box is floated right, content flows on the left side of the box, starting at the top (again subject to the 'clear' property). |
Value: | [ [ <'font-style'> || <'font-variant'> || <'font-weight'> ]? <'font-size'> [ / <line-height> ]? <font-family> ] | caption | icon | menu | message-box | small-caption | status-bar | inherit |
---|---|
Initial: | See individual properties |
Applies to: | All elements |
Inherited: | Yes |
Percentages: | See individual properties |
Media: | Visual |
Computed value: | See individual properties |
Description: | A shorthand property for setting 'font-style', 'font-variant', 'font-weight', 'font-size', 'line-height' and 'font-family' at the same place in the style sheet.The following values refer to system fonts:
|
Value: | [[ <family-name> | <generic-family> ] [, <family-name>| <generic-family>]* ] | inherit |
---|---|
Initial: | Depends on user agent |
Applies to: | All elements |
Inherited: | Yes |
Percentages: | N/A |
Media: | Visual |
Computed value: | As specified |
Description: | Specifies a prioritized list of font family names (e.g.Arial, Helvetica, "Times New Roman", Times etc.) and/or generic family names (e.g.serif, sans-serif, monospace etc.). Values are separated by a comma to indicate that they are alternatives. |
Value: | <absolute-size> | <relative-size> | <length> | <percentage> | inherit |
---|---|
Initial: | medium |
Applies to: | All elements |
Inherited: | Yes |
Percentages: | Refer to inherited font size |
Media: | Visual |
Computed value: | Absolute length |
Description: | Specifies the size of a font. |
Value: | normal | italic | oblique | inherit |
---|---|
Initial: | normal |
Applies to: | All elements |
Inherited: | Yes |
Percentages: | N/A |
Media: | Visual |
Computed value: | As specified |
Description: | Specifies the font style for a text. |
Value: | normal | small-caps | inherit |
---|---|
Initial: | normal |
Applies to: | All elements |
Inherited: | Yes |
Percentages: | N/A |
Media: | Visual |
Computed value: | As specified |
Description: | Specifies whether or not a text should be displayed in a small-caps font (in the small-caps variant of a font, all lowercase letters are converted to uppercase letters, but using a smaller font size and with slightly different proportions). |
Value: | normal | bold | bolder | lighter | 100 | 200 | 300 | 400 | 500 | 600 | 700 | 800 | 900 | inherit |
---|---|
Initial: | normal |
Applies to: | All elements |
Inherited: | Yes |
Percentages: | N/A |
Media: | Visual |
Computed value: | Depends on font |
Description: | Specifies the weight of the font. The keyword 'normal' is synonymous with '400', and 'bold' is synonymous with '700'. The 'bolder' and 'lighter' values select font weights that are relative to the weight inherited from the parent. |
Value: | <length> | <percentage> | auto | inherit |
---|---|
Initial: | auto |
Applies to: | All elements except non-replaced inline elements, table columns, and column groups |
Inherited: | No |
Percentages: | Calculated with respect to the height of the generated box's containing block, or 'auto' if the height of the containing block is not specified explicitly and the element is not absolutely positioned. |
Media: | Visual |
Computed value: | The percentage or 'auto' (see above) or the absolute length |
Description: | Specifies the content height of boxes (does not apply to non-replaced inline elements). |
Value: | flex-start | flex-end | center | space-between | space-around |
---|---|
Initial: | flex-start |
Applies to: | Flex containers |
Inherited: | No |
Percentages: | N/A |
Media: | Visual |
Computed value: | Specified keyword |
Description: | Specifies how flex items will be aligned along the main axis of the current line of the flex container if there is any free space on the main axis (i.e. if the flex items do not take up all available space on the main-axis). The justify-content property takes the following values:
|
Value: | <length> | <percentage> | auto | inherit |
---|---|
Initial: | auto |
Applies to: | Positioned elements |
Inherited: | No |
Percentages: | Refer to width of containing block |
Media: | Visual |
Computed value: | If specified as a length, the corresponding absolute length; if specified as a percentage, the specified value; otherwise, 'auto' |
Description: | Specifies how far an absolutely positioned box's left margin edge is offset to the right of the left edge of the box's containing block. For relatively positioned boxes, the offset is with respect to the left edge of the box itself. Setting this property on non-positioned elements has no effect. |
Value: | normal | <length> | inherit |
---|---|
Initial: | normal |
Applies to: | All elements |
Inherited: | Yes |
Percentages: | N/A |
Media: | Visual |
Computed value: | 'normal' or absolute length |
Description: | Specifies the amount of space separating text characters. |
Value: | normal | <number> | <length> | <percentage> | inherit |
---|---|
Initial: | normal |
Applies to: | All elements |
Inherited: | Yes |
Percentages: | Refer to the font size of the element itself |
Media: | Visual |
Computed value: | For <length> and <percentage> the absolute value; otherwise as specified |
Description: | Specifies the height of a line of text. |
Value: | [ <'list-style-type'> || <'list-style-position'> || <'list-style-image'> ] | inherit |
---|---|
Initial: | See individual properties |
Applies to: | Elements with 'display: list-item' |
Inherited: | Yes |
Percentages: | N/A |
Media: | Visual |
Computed value: | See individual properties |
Description: | A shorthand notation for setting the 'list-style-type', 'list-style-image', and 'list-style-position' properties at the same place in the style sheet. |
Value: | <uri> | none | inherit |
---|---|
Initial: | none |
Applies to: | Elements with 'display: list-item' |
Inherited: | Yes |
Percentages: | N/A |
Media: | Visual |
Computed value: | Absolute URI or 'none' |
Description: | Specifies an image to be used as the list item marker in place of the marker set with the 'list-style-type' marker. |
Value: | inside | outside | inherit |
---|---|
Initial: | outside |
Applies to: | Elements with 'display: list-item' |
Inherited: | Yes |
Percentages: | N/A |
Media: | Visual |
Computed value: | As specified |
Description: | Specifies the position of the list-item markers (e.g. bullet points, etc.). |
Value: | disc | circle | square | decimal | decimal-leading-zero | lower-roman | upper-roman | lower-greek | lower-latin | upper-latin | armenian | georgian | lower-alpha | upper-alpha | none | inherit |
---|---|
Initial: | disc |
Applies to: | Elements with 'display: list-item' |
Inherited: | Yes |
Percentages: | N/A |
Media: | Visual |
Computed value: | As specified |
Description: | Specifies the appearance of the list item marker if 'list-style-image' has the value 'none' or if the image pointed to by the URI cannot be displayed. The value 'none' specifies no marker, otherwise there are three types of marker: glyphs, numbering systems, and alphabetic systems. Glyphs are specified with 'disc', 'circle', and 'square'. Their exact rendering depends on the user agent. Numbering systems are specified with:
|
Value: | <margin-width>{1,4} | inherit |
---|---|
Initial: | See individual properties |
Applies to: | All elements except elements with table display types other than table-caption, table and inline-table |
Inherited: | No |
Percentages: | Refer to width of containing block |
Media: | Visual |
Computed value: | See individual properties |
Description: | A shorthand property for setting 'margin-top', 'margin-right', 'margin-bottom', and 'margin-left' at the same place in the style sheet. If there is only one component value, it applies to all sides. If there are two values, the top and bottom margins are set to the first value and the right and left margins are set to the second. If there are three values, the top is set to the first value, the left and right are set to the second, and the bottom is set to the third. If there are four values, they apply to the top, right, bottom, and left, respectively. |
Value: | <margin-width> | inherit |
---|---|
Initial: | 0 |
Applies to: | All elements except elements with table display types other than table-caption, table and inline-table |
Inherited: | No |
Percentages: | Refer to width of containing block |
Media: | Visual |
Computed value: | The percentage as specified or the absolute length |
Description: | Specifies the width of the bottom margin. |
Value: | <margin-width> | inherit |
---|---|
Initial: | 0 |
Applies to: | All elements except elements with table display types other than table-caption, table and inline-table |
Inherited: | No |
Percentages: | Refer to width of containing block |
Media: | Visual |
Computed value: | The percentage as specified or the absolute length |
Description: | Specifies the width of the left-hand margin. |
Value: | <margin-width> | inherit |
---|---|
Initial: | 0 |
Applies to: | All elements except elements with table display types other than table-caption, table and inline-table |
Inherited: | No |
Percentages: | Refer to width of containing block |
Media: | Visual |
Computed value: | The percentage as specified or the absolute length |
Description: | Specifies the width of the right-hand margin. |
Value: | <margin-width> | inherit |
---|---|
Initial: | 0 |
Applies to: | All elements except elements with table display types other than table-caption, table and inline-table |
Inherited: | No |
Percentages: | Refer to width of containing block |
Media: | Visual |
Computed value: | The percentage as specified or the absolute length |
Description: | Specifies the width of the top margin. |
Value: | <length> | <percentage> | none | inherit |
---|---|
Initial: | none |
Applies to: | All elements but non-replaced inline elements, table columns, and column groups |
Inherited: | No |
Percentages: | Calculated with respect to the height of the containing block; if the height of the containing block is not specified explicitly and this element is not absolutely positioned, the percentage value is treated as 'none' |
Media: | Visual |
Computed value: | The percentage as specified or the absolute length or 'none' |
Description: | Used to specify the maximum height of a box. Negative values are not allowed. |
Value: | <length> | <percentage> | none | inherit |
---|---|
Initial: | none |
Applies to: | All elements but non-replaced inline elements, table rows, and row groups |
Inherited: | No |
Percentages: | Refer to width of containing block |
Media: | Visual |
Computed value: | The percentage as specified or the absolute length or 'none' |
Description: | Used to specify the maximum width of a box. Negative values are not allowed. |
Value: | <length> | <percentage> | none | inherit |
---|---|
Initial: | none |
Applies to: | All elements but non-replaced inline elements, table columns, and column groups |
Inherited: | No |
Percentages: | Calculated with respect to the height of the containing block; if the height of the containing block is not specified explicitly and this element is not absolutely positioned, the percentage value is treated as '0' |
Media: | Visual |
Computed value: | The percentage as specified or the absolute length or 'none' |
Description: | Used to specify the minimum height of a box. Negative values are not allowed. |
Value: | <length> | <percentage> | none | inherit |
---|---|
Initial: | none |
Applies to: | All elements but non-replaced inline elements, table rows, and row groups |
Inherited: | No |
Percentages: | Refer to width of containing block |
Media: | Visual |
Computed value: | The percentage as specified or the absolute length or 'none' |
Description: | Used to specify the minimum width of a box. Negative values are not allowed. |
Value: | <alphavalue> | inherit |
---|---|
Initial: | 1 |
Applies to: | All elements |
Inherited: | No |
Percentages: | N/A |
Media: | Visual |
Computed value: | The same as the specified value after clipping the <alphavalue> to the range [0.0,1.0] |
Description: | Sets the degree of opacity for an element. |
Value: | <integer> |
---|---|
Initial: | 0 |
Applies to: | Flex items |
Inherited: | No |
Percentages: | N/A |
Media: | Visual |
Computed value: | Specified integer |
Description: | Controls the order in which flex items appear within the flex container by assigning them to ordinal groups. The <integer> value specifies which ordinal group the flex item belongs to. Flex items appear within the flex container in order-modified document order, starting with the lowest numbered group and proceeding in ascending numerical order. Items within the same ordinal group appear in the same order that they do in the source document. |
Value: | [ <'outline-color'> || <'outline-style'> || <'outline-width'> ] | inherit |
---|---|
Initial: | See individual properties |
Applies to: | All elements |
Inherited: | No |
Percentages: | N/A |
Media: | Visual, interactive |
Computed value: | See individual properties |
Description: | A shorthand property for specifying 'outline-width', 'outline-style' (required), and 'outline-color' at the same place in the style sheet (an outline is a line drawn around an element outside its borders to make it stand out). If outline-color is omitted, the colour of the text is used. |
Value: | <color> | invert | inherit |
---|---|
Initial: | invert |
Applies to: | All elements |
Inherited: | No |
Percentages: | N/A |
Media: | Visual, interactive |
Computed value: | As specified |
Description: | Specifies the colour of an outline (an outline is a line drawn around an element outside its borders to make it stand out). |
Value: | <length> |
---|---|
Initial: | 0 |
Applies to: | All elements |
Inherited: | No |
Percentages: | N/A |
Media: | Visual |
Computed value: | <length> value in absolute units (px or physical) |
Description: | Specifies the amount of space between an outline (an outline is a line drawn around an element outside its borders to make it stand out) and the edge or border of an element. The space between an element and its outline is transparent. |
Value: | <border-style> | inherit |
---|---|
Initial: | none |
Applies to: | All elements |
Inherited: | No |
Percentages: | N/A |
Media: | Visual, interactive |
Computed value: | As specified |
Description: | Specifies the style of an outline (an outline is a line drawn around an element outside its borders to make it stand out):
|
Value: | <border-width> | inherit |
---|---|
Initial: | medium |
Applies to: | All elements |
Inherited: | No |
Percentages: | N/A |
Media: | Visual, interactive |
Computed value: | Absolute length; '0' if the outline style is 'none' |
Description: | Specifies the width of an outline (an outline is a line drawn around an element outside its borders to make it stand out):
|
Value: | <padding-width>{1,4} | inherit |
---|---|
Initial: | See individual properties |
Applies to: | All elements except table-row-group, table-header-group, table-footer-group, table-row, table-column-group and table-column |
Inherited: | No |
Percentages: | Refer to width of containing block |
Media: | Visual |
Computed value: | See individual properties |
Description: | A shorthand property for setting 'padding-top', 'padding-right', 'padding-bottom', and 'padding-left' at the same place in the style sheet. If there is only one component value, it applies to all sides. If there are two values, the top and bottom paddings are set to the first value and the right and left paddings are set to the second. If there are three values, the top is set to the first value, the left and right are set to the second, and the bottom is set to the third. If there are four values, they apply to the top, right, bottom, and left, respectively. |
Value: | <padding-width> | inherit |
---|---|
Initial: | 0 |
Applies to: | All elements except table-row-group, table-header-group, table-footer-group, table-row, table-column-group and table-column |
Inherited: | No |
Percentages: | Refer to width of containing block |
Media: | Visual |
Computed value: | The percentage as specified or the absolute length |
Description: | Specifies the width of the bottom padding. |
Value: | <padding-width> | inherit |
---|---|
Initial: | 0 |
Applies to: | All elements except table-row-group, table-header-group, table-footer-group, table-row, table-column-group and table-column |
Inherited: | No |
Percentages: | Refer to width of containing block |
Media: | Visual |
Computed value: | The percentage as specified or the absolute length |
Description: | Specifies the width of the left-hand padding. |
Value: | <padding-width> | inherit |
---|---|
Initial: | 0 |
Applies to: | All elements except table-row-group, table-header-group, table-footer-group, table-row, table-column-group and table-column |
Inherited: | No |
Percentages: | Refer to width of containing block |
Media: | Visual |
Computed value: | The percentage as specified or the absolute length |
Description: | Specifies the width of the right-hand padding. |
Value: | <padding-width> | inherit |
---|---|
Initial: | 0 |
Applies to: | All elements except table-row-group, table-header-group, table-footer-group, table-row, table-column-group and table-column |
Inherited: | No |
Percentages: | Refer to width of containing block |
Media: | Visual |
Computed value: | The percentage as specified or the absolute length |
Description: | Specifies the width of the top padding. |
Value: | auto | always | avoid | left | right | inherit |
---|---|
Initial: | auto |
Applies to: | block-level elements (but not absolutely positioned elements) |
Inherited: | No |
Percentages: | N/A |
Media: | Visual, paged |
Computed value: | As specified |
Description: | Adds a page-break after a specified element (together with 'page-break-before' and 'page-break-inside', helps to define how a document should behave when printed). |
Value: | auto | always | avoid | left | right | inherit |
---|---|
Initial: | auto |
Applies to: | block-level elements (but not absolutely positioned elements) |
Inherited: | No |
Percentages: | N/A |
Media: | Visual, paged |
Computed value: | As specified |
Description: | Adds a page-break before a specified element (together with 'page-break-after' and 'page-break-inside', helps to define how a document should behave when printed). |
Value: | auto | avoid | inherit |
---|---|
Initial: | auto |
Applies to: | block-level elements (but not absolutely positioned elements) |
Inherited: | No |
Percentages: | N/A |
Media: | Visual, paged |
Computed value: | As specified |
Description: | Specifies whether a page-break should be avoided inside a specified element (together with 'page-break-before' and 'page-break-after', helps to define how a document should behave when printed). |
Value: | static | relative | absolute | fixed | inherit |
---|---|
Initial: | static |
Applies to: | All elements |
Inherited: | No |
Percentages: | N/A |
Media: | Visual |
Computed value: | As specified |
Description: | Specifies the positioning method used for an element:
|
Value: | <length> | <percentage> | auto | inherit |
---|---|
Initial: | auto |
Applies to: | Positioned elements |
Inherited: | No |
Percentages: | Refer to width of containing block |
Media: | Visual |
Computed value: | If specified as a length, the corresponding absolute length; if specified as a percentage, the specified value; otherwise, 'auto' |
Description: | Specifies how far an absolutely positioned box's right margin edge is offset to the left of the right edge of the box's containing block. For relatively positioned boxes, the offset is with respect to the right edge of the box itself. Setting this property on non-positioned elements has no effect. |
Value: | left | right | center | justify | inherit |
---|---|
Initial: | left if text direction is left-to-right, right if text direction is right-to-left |
Applies to: | Block containers |
Inherited: | Yes |
Percentages: | N/A |
Media: | Visual |
Computed value: | The initial value or as specified |
Description: | Specifies the horizontal alignment of text in an element. |
Value: | none | [ underline || overline || line-through || blink ] | inherit |
---|---|
Initial: | none |
Applies to: | All elements |
Inherited: | No |
Percentages: | N/A |
Media: | Visual |
Computed value: | As specified |
Description: | Specifies the decoration added to text, using the element's colour. Values have the following meanings:
|
Value: | <length> | <percentage> | inherit |
---|---|
Initial: | 0 |
Applies to: | Block containers |
Inherited: | Yes |
Percentages: | Refer to width of containing block |
Media: | Visual |
Computed value: | The percentage as specified or the absolute length |
Description: | Specifies the indentation of the first line of text in a block container. |
Value: | capitalize | uppercase | lowercase | none | inherit |
---|---|
Initial: | none |
Applies to: | All elements |
Inherited: | Yes |
Percentages: | As specified |
Media: | Visual |
Computed value: | As specified |
Description: | Controls capitalisation effects of an element's text:
|
Value: | <length> | <percentage> | auto | inherit |
---|---|
Initial: | auto |
Applies to: | Positioned elements |
Inherited: | No |
Percentages: | Refer to width of containing block |
Media: | Visual |
Computed value: | If specified as a length, the corresponding absolute length; if specified as a percentage, the specified value; otherwise, 'auto' |
Description: | Specifies how far an absolutely positioned box's top margin edge is offset below the top edge of the box's containing block. For relatively positioned boxes, the offset is with respect to the top edge of the box itself. Setting this property on non-positioned elements has no effect. |
Value: | baseline | sub | super | top | text-top | middle | bottom | text-bottom | <percentage> | <length> | inherit |
---|---|
Initial: | baseline |
Applies to: | Inline-level and 'table-cell' elements |
Inherited: | No |
Percentages: | Refer to the 'line-height' of the element itself |
Media: | Visual |
Computed value: | For <percentage> and <length> the absolute length, otherwise as specified |
Description: | Specifies the vertical alignment of an element (note that values have different meanings in the context of tables):
|
Value: | visible | hidden | collapse | inherit |
---|---|
Initial: | visible |
Applies to: | All elements |
Inherited: | Yes |
Percentages: | N/A |
Media: | Visual |
Computed value: | As specified |
Description: | Specifies whether or not an element is visible (invisible boxes still affect layout):
|
Value: | normal | pre | nowrap | pre-wrap | pre-line | inherit |
---|---|
Initial: | normal |
Applies to: | All elements |
Inherited: | Yes |
Percentages: | N/A |
Media: | Visual |
Computed value: | As specified |
Description: | Specifies how white space inside an element is handled:
|
Value: | <length> | <percentage> | auto | inherit |
---|---|
Initial: | auto |
Applies to: | All elements except non-replaced inline elements, table rows, and row groups |
Inherited: | No |
Percentages: | Refer to width of containing block |
Media: | Visual |
Computed value: | The percentage or 'auto' as specified or the absolute length |
Description: | Specifies the content width of boxes (does not apply to non-replaced inline elements). |
Value: | normal | <length> | inherit |
---|---|
Initial: | normal |
Applies to: | All elements |
Inherited: | Yes |
Percentages: | N/A |
Media: | Visual |
Computed value: | For 'normal' the value '0'; otherwise the absolute length |
Description: | Specifies the amount of space separating words. |
Value: | auto | <integer> | inherit |
---|---|
Initial: | auto |
Applies to: | Positioned elements |
Inherited: | No |
Percentages: | N/A |
Media: | Visual |
Computed value: | As specified |
Description: | Specifies the stack order of an element. An element with greater stack order is always in front of an element with a lower stack order (only works on positioned elements). |