CSS Reference Manual
The CSS Reference Manual of Runoob Tutorial has been tested in all major browsers.
CSS properties
CSS property groups:
|
- Animation
- Background
- Borders and Outlines
- Box
- Color
- Media properties of content pages
- Size
- Box Model (New)
- Box Model (Old)
- Font
- Content generation
The "CSS" column indicates in which CSS version the property is defined (CSS1, CSS2, or CSS3).
Animation properties
| property | Description | CSS |
|---|---|---|
| @keyframes | Defines an animation; the animation name defined by @keyframes is used by animation-name. | 3 |
| animation | Shorthand property. Retrieves or sets the animation effects applied to an object. | 3 |
| animation-name | Retrieves or sets the animation name applied to an object; it must be used together with the @keyframes rule, because the animation name is defined by @keyframes. | 3 |
| animation-duration | Retrieves or sets the duration of the object's animation. | 3 |
| animation-timing-function | Retrieves or sets the transition type of the object's animation. | 3 |
| animation-delay | Retrieves or sets the delay time of the object's animation. | 3 |
| animation-iteration-count | Retrieves or sets the number of times the object's animation is repeated. | 3 |
| animation-direction | Retrieves or sets whether the object's animation runs in reverse on alternate cycles. | 3 |
| animation-play-state | Retrieves or sets the state of the object's animation. | 3 |
Background Properties
| property | Description | CSS |
|---|---|---|
| background | Shorthand property. Sets the background characteristics of an object. | 1 |
| background-attachment | Sets or retrieves whether the background image scrolls with the object's content or is fixed. The background-image property must be specified first. | 1 |
| background-color | Sets or retrieves the background color of an object. | 1 |
| background-image | Sets or retrieves the background image of an object. | 1 |
| background-position | Sets or retrieves the position of the object's background image. The background-image property must be specified first. | 1 |
| background-repeat | Sets or retrieves how the object's background image is tiled. The background-image property must be specified first. | 1 |
| background-clip | Specifies the area outside which the object's background image is clipped. | 3 |
| background-origin | Sets or retrieves the reference origin (position) used by the object's background image when calculating background-position. | 3 |
| background-size | Retrieves or sets the size of the object's background image. | 3 |
Border and Outline Properties
| property | Description | CSS |
|---|---|---|
| border | Shorthand property. Sets the characteristics of an object's border. | 1 |
| border-bottom | Shorthand property. Sets the characteristics of an object's bottom border. | 1 |
| border-bottom-color | Sets or retrieves the color of an object's bottom border. | 1 |
| border-bottom-style | Sets or retrieves the style of an object's bottom border. | 1 |
| border-bottom-width | Sets or retrieves the width of an object's bottom border. | 1 |
| border-color | Sets or retrieves the color of an object's border. | 1 |
| border-left | Shorthand property. Sets the characteristics of an object's left border. | 1 |
| border-left-color | Sets or retrieves the color of an object's left border. | 1 |
| border-left-style | Sets or retrieves the style of an object's left border. | 1 |
| border-left-width | Sets or retrieves the width of an object's left border. | 1 |
| border-right | Shorthand property. Sets the characteristics of an object's right border. | 1 |
| border-right-color | Sets or retrieves the color of an object's right border. | 1 |
| border-right-style | Sets or retrieves the style of an object's right border. | 1 |
| border-right-width | Sets or retrieves the width of an object's right border. | 1 |
| border-style | Sets or retrieves the style of an object's border. | 1 |
| border-top | Shorthand property. Sets the characteristics of an object's top border. | 1 |
| border-top-color | Sets or retrieves the color of an object's top border. | 1 |
| border-top-style | Sets or retrieves the style of an object's top border. | 1 |
| border-top-width | Sets or retrieves the width of an object's top border. | 1 |
| border-width | Sets or retrieves the width of an object's border. | 1 |
| outline | Shorthand property. Sets the outline (line) outside an object. | 2 |
| outline-color | Sets or retrieves the color of the outline outside an object. | 2 |
| outline-style | Sets or retrieves the style of the outline outside an object. | 2 |
| outline-width | Sets or retrieves the width of the outline outside an object. | 2 |
| border-bottom-left-radius | Sets or retrieves the rounded border of an object's bottom-left corner. Two parameters are provided, separated by a space; each parameter allows one value. The first parameter represents the horizontal radius and the second the vertical radius. If the second parameter is omitted, it defaults to the first parameter. | 3 |
| border-bottom-right-radius | Sets or retrieves the rounded border of an object's bottom-right corner. | 3 |
| border-image | Sets or retrieves the border style of an object to be filled with an image. | 3 |
| border-image-outset | Specifies the amount by which the border image extends beyond the border. | 3 |
| border-image-repeat | Specifies whether the image border should be repeated, stretched, or rounded. | 3 |
| border-image-slice | Specifies the inward offset of the image border. | 3 |
| border-image-source | Specifies the image to use in place of the border style set by the border-style property. | 3 |
| border-image-width | Specifies the width of the image border. | 3 |
| border-radius | Sets or retrieves rounded corners for an object's border. | 3 |
| border-top-left-radius | Defines the shape of the top-left corner border. | 3 |
| border-top-right-radius | Defines the shape of the top-right corner border. | 3 |
| box-decoration-break | Specifies that inline elements are wrapped. | 3 |
| box-shadow | Adds one or more shadows to a box. | 3 |
Box Properties
| property | Description | CSS |
|---|---|---|
| overflow-x | Whether to clip the left/right edges of content if it overflows the element's content area. | 3 |
| overflow-y | Whether to clip the top/bottom edges of content if it overflows the element's content area. | 3 |
| overflow-style | Specifies the preferred scrolling method for overflowing elements. | 3 |
| rotation | Rotates an element around the point defined by the rotation-point property. | 3 |
| rotation-point | Defines an offset point from the top-left border edge. | 3 |
Color Properties
| property | Description | CSS |
|---|---|---|
| color-profile | Allows specifications other than the default of the source color profile. | 3 |
| opacity | Sets the opacity level of an element. | 3 |
| rendering-intent | Allows other specifications beyond the rendering intent of the default color profile. | 3 |
Padding Properties
| property | Description | CSS |
|---|---|---|
| padding | Sets all padding properties in a single declaration. | 1 |
| padding-bottom | Sets the bottom padding of an element. | 1 |
| padding-left | Sets the left padding of an element. | 1 |
| padding-right | Sets the right padding of an element. | 1 |
| padding-top | Sets the top padding of an element. | 1 |
Paged Media Content Properties
| property | Description | CSS |
|---|---|---|
| bookmark-label | Specifies the label of a bookmark. | 3 |
| bookmark-level | Specifies the level of a bookmark. | 3 |
| bookmark-target | Specifies the target of a bookmark link. | 3 |
| float-offset | Pushes floating elements in the opposite direction; they always retain their float. | 3 |
| hyphenate-after | Specifies the minimum number of characters after the hyphenation character in a hyphenated word. | 3 |
| hyphenate-before | Specifies the minimum number of characters before the hyphenation character in a hyphenated word. | 3 |
| hyphenate-character | Specifies the string to display when hyphenation occurs. | 3 |
| hyphenate-lines | Indicates the maximum number of consecutively hyphenated lines in an element. | 3 |
| hyphenate-resource | Specifies a comma-separated list of external resources that can help determine hyphenation points in the browser. | 3 |
| hyphens | Sets how words are split to improve the layout of the paragraph. | 3 |
| image-resolution | Specifies the correct image resolution. | 3 |
| marks | Adds crop and/or cross marks to the document. | 3 |
| string-set | 3 |
Dimension Properties
| property | Description | CSS |
|---|---|---|
| height | Set the height of an element | 1 |
| max-height | Sets the maximum height of an element. | 2 |
| max-width | Sets the maximum width of an element. | 2 |
| min-height | Sets the minimum height of an element. | 2 |
| min-width | Sets the minimum width of an element. | 2 |
| width | Set the width of an element | 1 |
Flexible Box Layout Properties (New)
| property | Description | CSS |
|---|---|---|
| flex | Shorthand property. Sets or retrieves how the child elements of a flexible box model object distribute space. | 3 |
| flex-grow | Sets or retrieves the flex-grow factor of a flex container. | 3 |
| flex-shrink | Sets or retrieves the flex-shrink factor of a flex container. | 3 |
| flex-basis | Sets or retrieves the flex-basis of a flex container. | 3 |
| flex-flow | Shorthand property. Sets or retrieves the arrangement of child elements of a flexible box model object. | 3 |
| flex-direction | This property determines the position of flex items in a flex container by defining the main axis direction of the flex container. | 3 |
| flex-wrap | This property controls whether the flex container is single-line or multi-line, and the direction of the cross axis determines the direction in which new lines are stacked. | 3 |
| align-content | Aligns items inside a flex container when they do not occupy all available space on the cross axis (vertical). | 3 |
| align-items | Defines the alignment of flex items along the cross axis (vertical) of the current line in a flex container. | 3 |
| align-self | Defines the alignment of an individual flex item along the cross axis (vertical). | 3 |
| justify-content | Sets or retrieves the alignment of flexbox items along the main axis (horizontal). | 3 |
| order | Sets or retrieves the order in which child elements of a flexible box model object appear. | 3 |
Flexible Box Layout Properties (Old)
| property | Description | CSS |
|---|---|---|
| box-align | Specifies how to align the child elements of a box. | 3 |
| box-direction | Specifies the direction in which the child elements of a box are displayed. | 3 |
| box-flex | Specifies whether the child elements of a box are flexible or fixed in size. | 3 |
| box-flex-group | Assigns a flexible element to a flex group. | 3 |
| box-lines | Specifies whether to wrap onto a new row or column whenever it runs out of space in the parent box. | 3 |
| box-ordinal-group | Specifies the display order of the child elements of a box. | 3 |
| box-orient | Specifies whether the child elements of a box should be laid out horizontally or vertically. | 3 |
| box-pack | Specifies the horizontal and vertical position of a horizontal box within a vertical box. | 3 |
Font Properties
| property | Description | CSS |
|---|---|---|
| font | Sets all font properties in a single declaration. | 1 |
| font-family | Specifies the font family of text. | 1 |
| font-size | Specifies the font size of text. | 1 |
| font-style | Specifies the font style of text. | 1 |
| font-variant | Specifies the font style of text. | 1 |
| font-weight | Specifies the weight of the font. | 1 |
| @font-face | A rule that allows a website to download and use fonts other than the "web-safe" fonts. | 3 |
| font-size-adjust | Specifies an aspect value for an element. | 3 |
| font-stretch | Condenses or expands the current font family. | 3 |
Generated Content Properties
| property | Description | CSS |
|---|---|---|
| content | Used together with the :before and :after pseudo-elements to insert generated content. | 2 |
| counter-increment | Increments or decrements one or more counters. | 2 |
| counter-reset | Creates or resets one or more counters. | 2 |
| quotes | Sets the type of quotation marks for nested quotes. | 2 |
| crop | Allows a replaced element to be just an object in place of the entire rectangular area of the object. | 3 |
| move-to | Removes an element from the flow and then re-inserts it at a later point in the document. | 3 |
| page-policy | Determines the string value applicable to a counter for a given element based on the page. | 3 |
Grid Properties
| property | Description | CSS |
|---|---|---|
| grid-column | Sets the start and end positions of a grid element's columns. | 3 |
| grid-row | Sets the start and end positions of a grid element's rows. | 3 |
Hyperlink Properties
| property | Description | CSS |
|---|---|---|
| target | Shorthand property that sets the target-name, target-new, and target-position properties. | 3 |
| target-name | Specifies where to open the link (target position). | 3 |
| target-new | Specifies whether a new target link opens in a new window or a new tab in an existing window. | 3 |
| target-position | Specifies where the new target link should be placed. | 3 |
Line Box Properties
| property | Description | CSS |
|---|---|---|
| alignment-adjust | Allows more precise alignment of elements. | 3 |
| alignment-baseline | How inline-level elements specified by their parent are aligned. | 3 |
| baseline-shift | Allows repositioning of the dominant-baseline relative to the dominant-baseline. | 3 |
| dominant-baseline | Specifies the scaled-baseline-table. | 3 |
| drop-initial-after-adjust | Sets the initial alignment point of the drop's primary attachment point. | 3 |
| drop-initial-after-align | Aligns the initial line within a line so that the box with an initial letter uses the primary attachment point. | 3 |
| drop-initial-before-adjust | Sets the initial alignment point of the drop's secondary attachment point. | 3 |
| drop-initial-before-align | Aligns the initial line within a line so that the box with an initial letter uses the secondary attachment point. | 3 |
| drop-initial-size | Controls local initial-letter sinking. | 3 |
| drop-initial-value | Activates a drop-cap effect. | 3 |
| inline-box-align | Sets the alignment of lines within a multi-line inline block with previous and next inline elements. | 3 |
| line-stacking | A shorthand property that sets the line-stacking-strategy, line-stacking-ruby, and line-stacking-shift properties. | 3 |
| line-stacking-ruby | Sets the stacking method of lines containing Ruby annotation elements relative to block elements. | 3 |
| line-stacking-shift | Sets the stacking method of block elements in a base-shift line. | 3 |
| line-stacking-strategy | Sets the stacking method of line boxes that internally contain block elements. | 3 |
| text-height | Sets the block-progression dimension of the text content area of an inline box. | 3 |
List Properties
| property | Description | CSS |
|---|---|---|
| list-style | Sets all list properties in a single declaration. | 1 |
| list-style-image | Sets an image as the list item marker. | 1 |
| list-style-position | Sets the placement of the list item marker. | 1 |
| list-style-type | Sets the type of the list item marker. | 1 |
Margin Properties
| property | Description | CSS |
|---|---|---|
| margin | Sets all margin properties in a single declaration. | 1 |
| margin-bottom | Sets the bottom margin of an element. | 1 |
| margin-left | Sets the left margin of an element. | 1 |
| margin-right | Sets the right margin of an element. | 1 |
| margin-top | Sets the top margin of an element. | 1 |
Marquee Properties
| property | Description | CSS |
|---|---|---|
| marquee-direction | Sets the direction in which content moves. | 3 |
| marquee-play-count | Sets how many times content moves. | 3 |
| marquee-speed | Sets how fast content scrolls. | 3 |
| marquee-style | Sets the style in which content moves. | 3 |
Multi-column Properties
| property | Description | CSS |
|---|---|---|
| column-count | Specifies the number of columns an element should be divided into. | 3 |
| column-fill | Specifies how columns are filled. | 3 |
| column-gap | Specifies the gap between columns. | 3 |
| column-rule | Shorthand property for setting all column-rule-* properties. | 3 |
| column-rule-color | Specifies the color rule between columns. | 3 |
| column-rule-style | Specifies the style rule between columns. | 3 |
| column-rule-width | Specifies the width rule between columns. | 3 |
| column-span | Specifies how many columns an element should span. | 3 |
| column-width | Specifies the width of columns. | 3 |
| columns | Shorthand property that sets column width and column count. | 3 |
Paged Media Properties
| property | Description | CSS |
|---|---|---|
| fit | If both its width and height properties are not auto, gives a hint about how to scale a replaced element. | 3 |
| fit-position | Determines the alignment of an object within a box. | 3 |
| image-orientation | Specifies the rightward or clockwise rotation that the user agent applies to an image. | 3 |
| page | Specifies the specific type of page on which an element should be displayed. | 3 |
| size | Specifies the size and orientation of the page content containing the box. | 3 |
Positioning Properties
| property | Description | CSS |
|---|---|---|
| bottom | Sets the offset between the bottom margin edge of a positioned element and the bottom edge of its containing block. | 2 |
| clear | Specifies on which sides of an element other floating elements are not allowed. | 1 |
| clip | Clips an absolutely positioned element. | 2 |
| cursor | Specifies the type (shape) of cursor to display. | 2 |
| display | Specifies the type of box an element should generate. | 1 |
| float | Specifies whether a box should float. | 1 |
| left | Sets the offset between the left margin edge of a positioned element and the left edge of its containing block. | 2 |
| overflow | Specifies what happens when content overflows an element's box. | 2 |
| position | Specifies the positioning type of an element. | 2 |
| right | Sets the offset between the right margin edge of a positioned element and the right edge of its containing block. | 2 |
| top | Sets the offset between the top margin edge of a positioned element and the top edge of its containing block. | 2 |
| visibility | Specifies whether an element is visible. | 2 |
| z-index | Sets the stacking order of an element. | 2 |
Print Properties
| property | Description | CSS |
|---|---|---|
| orphans | Sets the minimum number of lines that must be left at the bottom of a page when a page break occurs inside an element. | 2 |
| page-break-after | Sets the page-break behavior after an element. | 2 |
| page-break-before | Sets the page-break behavior before an element. | 2 |
| page-break-inside | Sets the page-break behavior inside an element. | 2 |
| widows | Sets the minimum number of lines that must be left at the top of a page when a page break occurs inside an element. | 2 |
Ruby Properties
| property | Description | CSS |
|---|---|---|
| ruby-align | Controls the text alignment of Ruby text and Ruby base content relative to each other. | 3 |
| ruby-overhang | When Ruby text exceeds the width of its Ruby base, determines whether the Ruby text is allowed to overhang adjacent text, other than its own base. | 3 |
| ruby-position | Its base controls the position of the Ruby text. | 3 |
| ruby-span | Controls the spanning behavior of the annotation element. | 3 |
Speech Properties
| property | Description | CSS |
|---|---|---|
| mark | Shorthand property that sets the mark-before and mark-after properties. | 3 |
| mark-after | Allows named marks to be attached to the audio stream. | 3 |
| mark-before | Allows named marks to be attached to the audio stream. | 3 |
| phonemes | Specifies a phonetic pronunciation for the corresponding element containing text. | 3 |
| rest | A shorthand property that sets the rest-before and rest-after properties. | 3 |
| rest-after | Specifies a pause or prosodic boundary after the content of an element has been spoken. | 3 |
| rest-before | Specifies a pause or prosodic boundary before the content of an element is spoken. | 3 |
| voice-balance | Specifies the balance between the left and right channels. | 3 |
| voice-duration | Specifies the length at which the content of the selected element should be rendered. | 3 |
| voice-pitch | Specifies the pitch (frequency) of the speaking voice. | 3 |
| voice-pitch-range | Specifies the variation in average pitch. | 3 |
| voice-rate | Controls the speaking rate. | 3 |
| voice-stress | Indicates the stress intensity. | 3 |
| voice-volume | In speech synthesis, refers to the waveform output amplitude. | 3 |
Table Properties
| property | Description | CSS |
|---|---|---|
| border-collapse | Specifies whether table borders are collapsed. | 2 |
| border-spacing | Specifies the distance between the borders of adjacent cells. | 2 |
| caption-side | Specifies the position of a table caption. | 2 |
| empty-cells | Specifies whether borders and backgrounds are shown on empty cells in a table. | 2 |
| table-layout | Sets the layout algorithm used for a table. | 2 |
Text Properties
| property | Description | CSS |
|---|---|---|
| color | Sets the color of text. | 1 |
| direction | Specifies the direction/writing direction of text. | 2 |
| letter-spacing | Sets the spacing between characters. | 1 |
| line-height | Sets the line height. | 1 |
| text-align | Specifies the horizontal alignment of text. | 1 |
| text-decoration | Specifies the decoration added to text. | 1 |
| text-indent | Specifies the indentation of the first line of a text block. | 1 |
| text-transform | Controls the capitalization of text. | 1 |
| unicode-bidi | 2 | |
| vertical-align | Sets the vertical alignment of an element. | 1 |
| white-space | Sets how much whitespace to leave around an element. | 1 |
| word-spacing | Sets the spacing between words. | 1 |
| text-emphasis | Applies emphasis marks and the foreground color of the emphasis marks to an element's text. | 1 |
| hanging-punctuation | Specifies whether a punctuation mark is allowed to hang outside the line box. | 3 |
| punctuation-trim | Specifies whether a punctuation mark is to be removed. | 3 |
| text-align-last | The alignment of the last line when text-align is set to justify. | 3 |
| text-justify | Specifies the distribution method when text-align is set to justify. | 3 |
| text-outline | Sets the outline of text. | 3 |
| text-overflow | Specifies what should happen when text overflows its containing element. | 3 |
| text-shadow | Adds a shadow to text. | 3 |
| text-wrap | Specifies text wrapping rules. | 3 |
| word-break | Specifies line-breaking rules for non-CJK text. | 3 |
| word-wrap | Sets whether the browser breaks very long words. | 3 |
2D/3D Transform Properties
| property | Description | CSS |
|---|---|---|
| transform | Applies a 2D or 3D transform to an element. | 3 |
| transform-origin | Allows you to change the position of a transformed element. | 3 |
| transform-style | Specifies how elements are nested in 3D space. | 3 |
| perspective | Specifies the perspective from which a 3D element is viewed. | 3 |
| perspective-origin | Specifies the bottom position of a 3D element. | 3 |
| backface-visibility | Defines whether an element should be visible when it is not facing the screen. | 3 |
Transition Properties
| property | Description | CSS |
|---|---|---|
| transition | This property is a shorthand for transition-property, transition-duration, transition-timing-function, and transition-delay. | 3 |
| transition-property | Sets the CSS properties used for the transition. | 3 |
| transition-duration | Sets the length of time the transition takes. | 3 |
| transition-timing-function | Sets the timing function of the transition. | 3 |
| transition-delay | Specifies the time at which the transition starts. | 3 |
User-interface Properties
| property | Description | CSS |
|---|---|---|
| appearance | Defines the appearance style of an element. | 3 |
| box-sizing | Allows you to define certain elements in a certain way to fit a region. | 3 |
| icon | Specifies an icon for an element. | 3 |
| nav-down | Specifies the position to navigate down to when the user presses the down key. | 3 |
| nav-index | Specifies the navigation (tab) order. | 3 |
| nav-left | Specifies the position to navigate left to when the user presses the left key. | 3 |
| nav-right | Specifies the position to navigate right to when the user presses the right key. | 3 |
| nav-up | Specifies the position to navigate up to when the user presses the up key a. | 3 |
| outline-offset | Sets the offset of the outline frame outside the border edge. | 3 |
| resize | Defines whether an element can be resized. | 3 |