CSS Properties Complete Reference
CSS properties are individual attributes for the web design to define the style and appearance of HTML elements.
This CSS reference provides the complete guide to all CSS properties with examples. You can practice the example by clicking on the "Try It" button.
Search CSS Properties
All CSS Propetries
Following is the list of all CSS properties arranged alphabetically.
A
B
| Property | Description | Example |
|---|---|---|
| backdrop-filter | Defines a visual impact on the space behind an element. | |
| backface-visibility | Specifies whether an element's back face should be revealed when facing the user. | |
| background | Shorthand for background related properties. | |
| background-attachment | Specifies the position of the background relative to the viewport, either fixed or scrollable. | |
| background-clip | Controls how far a background image extends beyond the element's padding or content box. | |
| background-color | Sets the background color of an element. | |
| background-image | Sets one or more background image(s) on an element. | |
| background-origin | Sets the origin of the background. | |
| background-position | Sets the initial position of each image in a background. | |
| background-position-x | Sets the initial horizontal position of each image in a background. | |
| background-position-y | Sets the initial vertical position of each image in a background. | |
| background-repeat | Controls the repetition of an image in the background. | |
| background-size | Controls the size of the background image. | |
| background-blend-mode | Determines how an element's background images blend with each other. | |
| border | Sets the border of an element. | |
| border-block | Shorthand for setting the logical block border property values. | |
| border-block-color | Defines the color of the borders in the block direction (top and bottom). | |
| border-block-end | Shorthand property for setting the logical block end border properties. | |
| border-block-end-color | Defines the color of the logical block-end border of an element. | |
| border-block-end-style | Defines the style of the logical block-end border of an element. | |
| border-block-end-width | Defines the width of the logical block-end border of an element. | |
| border-block-start | Shorthand property for setting the logical block-start border properties. | |
| border-block-start-color | Defines the color of the logical block-start border of an element. | |
| border-block-start-style | Defines the style of the logical block start border of an element. | |
| border-block-start-width | Defines the width of the logical block-start border of an element. | |
| border-block-style | Defines the style of the top and bottom block borders of an element. | |
| border-block-width | Defines the width of the top and bottom block borders of an element. | |
| border-bottom | Shorthand property sets the element's bottom border. | |
| border-bottom-color | Sets the color of an element's bottom border. | |
| border-bottom-left-radius | Rounds the bottom-left corner of an element. | |
| border-bottom-right-radius | Rounds the bottom-right corner of an element. | |
| border-bottom-style | Sets the style of the bottom border. | |
| border-bottom-width | Sets the width of the bottom border. | |
| border-collapse | Specifies whether the borders of a table should be divided or collapsed into a single border. | |
| border-color | Sets the color of the border(s). | |
| border-end-end-radius | Defines a bottom-right border radius on an element. | |
| border-end-start-radius | Defines a bottom-left border radius on an element. | |
| border-image | Sets an image as border to an element. | |
| border-image-outset | Defines how much of the border image area goes outside of the border box. | |
| border-image-repeat | Specifies whether the border image should be stretched, rounded, or repeated. | |
| border-image-slice | Divides the border image into regions. | |
| border-image-source | Defines the path to the image that will be used as the border. | |
| border-image-width | Sets the width of the border image. | |
| border-inline | Shorthand property for setting the individual logical inline border property values. | |
| border-inline-color | Defines the color of the logical inline borders of an element. | |
| border-inline-end | Shorthand property for setting the logical inline-end border property values. | |
| border-inline-end-color | Sets the color of the logical inline-end border. (right border) | |
| border-inline-end-style | Sets the style of the logical inline-end border. (right border) | |
| border-inline-end-width | Sets the width of the logical inline-end border. (right border) | |
| border-inline-start | Shorthand property for setting the logical inline-start border (left border) property values. | |
| border-inline-start-color | Sets the color of the inline-start border (left border). | |
| border-inline-start-style | Sets the style of the logical inline-start border (left border). | |
| border-inline-start-width | Sets the width of the logical inline-start border (left border). | |
| border-inline-style | Defines the style of the left and right inline borders of an element. | |
| border-inline-width | Defines the width of the left and right inline borders of an element. | |
| border-left | Shorthand for setting all the properties of the left border of an element. | |
| border-left-color | Defines the color of the left border of an element. | |
| border-left-style | Defines the style of the left border of an element. | |
| border-left-width | Defines the width of the left border of an element. | |
| border-radius | Rounds the corners of an element's outer border edge. | |
| border-right | Shorthand for setting all the properties of the right border of an element. | |
| border-right-color | Defines the color of the right border of an element. | |
| border-right-style | Defines the style of the right border of an element. | |
| border-right-width | Defines the width of the right border of an element. | |
| border-spacing | Defines a distance between borders of adjacent cells in a table. | |
| border-start-end-radius | Defines a top-right border radius on an element, between the block-start and inline-end sides. | |
| border-start-start-radius | Defines a top-left border radius on an element, between the block-start and inline-start sides. | |
| border-style | Sets the line style for all four sides of an element's border. | |
| border-top | Shorthand property setting all the properties of the top border of an element. | |
| border-top-color | Defines the color of the top border. | |
| border-top-left-radius | Sets the roundness of the top-left corner of an element's border. | |
| border-top-right-radius | Rounds the top-right corner of an element. | |
| border-top-style | Sets the line style of top border of an element. | |
| border-top-width | Sets the width of top border of an element. | |
| border-width | Sets the width of an element's border. | |
| bottom | Sets the vertical position of an element. | |
| box-decoration-break | Defines how an element's border and background will behave during page breaks or, in the case of inline elements, at line breaks. | |
| box-shadow | Adds a shadow effect around an element. | |
| box-sizing | Sets the way, the total width and height of an element is calculated. | |
| break-after | Defines whether the given element should be followed by a page, column, or region break. | |
| break-before | Defines whether a region, page, or column break should come before the given element. | |
| break-inside | Defines if the given element should have a page, column, or region break inside of it. |
C
| Property | Description | Example |
|---|---|---|
| caption-side | Defines where a table caption should be positioned. | |
| caret-color | Defines the color of the editable cursor (caret) in text areas, input fields, and other elements. | |
| @charset | Provides details about the character encoding that the style sheet uses. | |
| clear | Defines the behavior of the element next to a floating element. | |
| clip | Clips an element that is precisely positioned. | |
| clip-path | Creates a clipping region that sets the part of the element to be shown. | |
| color | Defines the foreground color of a text. | |
| column-count | Defines the number of columns into which an element should be divided. | |
| column-fill | Controls an element's contents and break it into columns. | |
| column-gap | Defines the size of the gap that exists between the columns in a multi-column layout.. | |
| column-rule | Shorthand property that sets the color, style, and width of the line drawn between columns in a multi-column layout. | |
| column-rule-color | Sets the color of the line drawn between columns in a multi-column layout. | |
| column-rule-style | Sets the style of the line drawn between columns in a multi-column layout. | |
| column-rule-width | Sets the width of the line drawn between columns in a multi-column layout. | |
| column-span | Defines whether an element should span across one column or all columns, in a multi-column layout. | |
| column-width | Sets the column width in a multi-column layout. | |
| columns | Shorthand property for setting the width and count of columns. | |
| content | Replaces content with a generated value. | |
| counter-increment | Used to increase or decrease the value of named CSS counters. | |
| counter-reset | Creates named CSS counters and initializes a specific value to them. | |
| counter-set | Sets a given value to a CSS counter. | |
| cursor | Defines the mouse pointer that will be displayed when pointing at an item. |
D
| Property | Description | Example |
|---|---|---|
| direction | Sets the direction of the text, table columns, and horizontal overflow. | |
| display | Defines the display method for a certain HTML element. |
E
| Property | Description | Example |
|---|---|---|
| empty-cells | Defines whether borders and backgrounds to be shown on empty cells in a table. |
F
| Property | Description | Example |
|---|---|---|
| filter | Applies graphical effects to an element. | |
| flex | Shorthand property that sets whether a flex item will grow or shrink. | |
| flex-basis | CSS flex-basis property sets the initial size of a flex item on the main axis before distributing the remaining space among the flex items | |
| flex-direction | CSS flex-direction property determines the direction in which flex items are placed within a flex container. ( horizontal and vertical ) | |
| flex-flow | Shorthand property for specifying the direction and wrapping behavior of a flex container. | |
| flex-grow | Determines how much extra space a flex item should take up in the flex container along its main axis. | |
| flex-shrink | Defines the shrinking of the item in relation to the others. | |
| flex-wrap | CSS flex-wrap property determines whether flex items should remain on a single line or are allowed to wrap onto multiple lines depending on the availability of space. | |
| float | Places an element on left or right side of its container. | |
| font | Shorthand property for setting all the font related properties. | |
| font-family | Defines the text's font family. | |
| font-feature-settings | Used to enable or disable specific OpenType font features, which control how text is rendered using advanced font features like ligatures, kerning, stylistic sets | |
| font-kerning | Determines how the kerning information, the spacing between letters, is used. | |
| font-language-override | Used to adjusting the rendering of glyphs and features to match the linguistic needs of different languages. | |
| font-size | Determines the font size of the text. | |
| font-size-adjust | Preserves text readability in the event of a font fallback. | |
| font-stretch | Selects the standard, condensed, or expanded face of a font. | |
| font-style | Sets the text's font style. | |
| font-synthesis | Determines whether or not the browser should synthesize a style that are missing in a font-family. | |
| font-variant | Sets all the font variants for a font. | |
| font-variant-alternate | Controls the use of alternate glyphs. | |
| font-variant-caps | Controls the use of alternate glyphs used for small capitals. | |
| font-variant-east-asian | Regulates the use of alternate glyphs for East Asian scripts, such as Chinese and Japanese. | |
| font-variant-ligatures | Regulates the usage of contextual forms and ligatures. | |
| font-variant-numeric | Regulates the use of different glyphs for ordinal markers, fractions, and integers. | |
| font-variant-position | Regulates the use of smaller alternate glyphs that are positioned as superscript or subscript. | |
| font-weight | Specifies the weight of a font. |
G
H
I
| Property | Description | Example |
|---|---|---|
| image-rendering | Defines the kind of image scaling approach to be used. | |
| inline-size | Defines the horizontal and vertical size of an element's block. | |
| inset | Indicates the distance an element is from edges of its parent element. | |
| inset-block | Defines the logical block start and end offsets of an element. | |
| inset-block-end | Defines the logical block end offsets of an element. | |
| inset-block-start | Defines the logical block start offsets of an element. | |
| inset-inline | Defines the logical start and end offsets of an element in the inline direction. | |
| inset-inline-end | Defines the distance, measured in the inline direction, between an element's end and its parent element. | |
| inset-inline-start | Defines the distance, measured in the inline direction, between an element's start and it's parent element. | |
| isolation | Defines if a new stacking content must be created by an element. |
J
| Property | Description | Example |
|---|---|---|
| justify-content | Defines how space is distributed between and around content items in a flex and grid container. | |
| justify-items | Defines how grid elements should be aligned along the horizontal axis within a grid container. | |
| justify-self | Defines how a grid item should be aligned in the inline direction that resides within a grid container. | |
| @keyframes | Defines a set of keyframes for animations or transitions. |
L
M
O
| Property | Description | Example |
|---|---|---|
| object-fit | Defines how an image or video should be resized or cropped to fit within its container. | |
| object-position | Defines the position of the content inside an element that has a defined size. | |
| offset | Shorthand property that makes used to position elements in container. | |
| offset-anchor | Defines the moving position of an element inside a box traveling along an offset-path. | |
| offset-distance | Defines the position along an offset-path where an element should be placed. | |
| offset-path | Defines an element's path inside its parent container or SVG coordinate system. | |
| offset-rotate | Defines the orientation or direction of an element as it moves along the specified offset-path. | |
| opacity | Sets the transparency of an element. | |
| order | Defines the order in which flex items appear within a flex container. | |
| orphans | Defines the minimum number of lines required at the bottom of a page, region, or column to prevent a break. | |
| outline | Sets the width, color, and style of an outline around an element. The outline is used to highlight an element when focused. | |
| outline-color | Sets the color of an outline around an element. | |
| outline-offset | Defines the space between an outline and the border edge of an element. | |
| outline-style | Determines the style of an outline around an element. | |
| outline-width | Defines the width of the outline around an element. | |
| overflow | Defines how to handle content that overflows the boundaries of its container. | |
| overflow-anchor | Provides a way to disable the browser's scroll anchoring behavior, which adjusts scroll position to reduce content shifting. | |
| overflow-wrap | Allows the browser to split a line of text into an unbreakable string to keep the content from overflowing its container. | |
| overflow-clip-margin | Defines the distance that content can overflow the element's box before being clipped. | |
| overflow-x | Defines that an element's content will overflow to its left and right margins, as well as horizontally. | |
| overflow-y | Defines how the content of a block-level element is displayed when it exceeds the element's top and bottom edges. | |
| overflow-block | Defines how the content of an element behaves when it exceeds the left and right boundaries of its box. | |
| overflow-inline | Defines how overflowing content is displayed when it overflows the inline edges of an element. | |
| overscroll-behavior | Determines what a browser does when the boundary of a scrolling area is reached. | |
| overscroll-behavior-block | Determines how the browser behaves when the block direction border of a scrolling region is reached. | |
| overscroll-behavior-inline | Determines how the browser behaves when the inline direction border of a scrolling region is reached. | |
| overscroll-behavior-x | Determines what a browser does when the horizontal boundary of a scrolling area is reached. | |
| overscroll-behavior-y | Determines what a browser does when the vertical boundary of a scrolling area is reached. |
P
Q
| Property | Description | Example |
|---|---|---|
| quotes | Defines the style of quotation marks to be used for embedded quotes. |
R
| Property | Description | Example |
|---|---|---|
| resize | Defines if and how a user can resize an element. | |
| right | Controls the horizontal position of an element | |
| rotate | Defines the way an element rotates. | |
| row-gap | Defines the gap between the grid rows. Also used to add gap between columns in multi-column layout. |
S
T
U
| Property | Description | Example |
|---|---|---|
| unicode-bidi | Controls how bidirectional text is displayed in a document. | |
| user-select | Determines if text can be selected by the user. |
V
| Property | Description | Example |
|---|---|---|
| vertical-align | Defines an element's vertical alignment. | |
| visibility | Defines if an element needs to be shown or hidden without changing the layout of a document. |
W
| Property | Description | Example |
|---|---|---|
| white-space | Defines the white space flow inside the text in an element. | |
| widows | Defines how many lines a page or column must have left at the top. | |
| width | Defines the width of an element's content area. | |
| word-break | Defines how words should be broken or wrapped in case they exceed the available width of an element. | |
| word-spacing | Defines the space between the words in a text. | |
| writing-mode | Defines if text should be displayed vertically or horizontally. |