Complete reference of CSS properties grouped by category, with accepted values and descriptions.
| Property | Description | Values / Syntax |
|---|---|---|
| width | Sets the width of an element. | auto | length | % |
| min-width | Sets the minimum width. Prevents shrinking below this. | 0 | length | % |
| max-width | Sets the maximum width. Prevents growing beyond this. | none | length | % |
| height | Sets the height of an element. | auto | length | % |
| min-height | Sets the minimum height. | 0 | length | % |
| max-height | Sets the maximum height. | none | length | % |
| margin | Shorthand for margin-top, right, bottom, left. | auto | length | % (1-4 values) |
| margin-top | Sets top margin of an element. | 0 | length | % | auto |
| margin-right | Sets right margin. | 0 | length | % | auto |
| margin-bottom | Sets bottom margin. | 0 | length | % | auto |
| margin-left | Sets left margin. | 0 | length | % | auto |
| padding | Shorthand for padding inside the border. | 0 | length | % (1-4 values) |
| padding-top | Space between content and top border. | 0 | length | % |
| padding-right | Space between content and right border. | 0 | length | % |
| padding-bottom | Space between content and bottom border. | 0 | length | % |
| padding-left | Space between content and left border. | 0 | length | % |
| box-sizing | border-box includes padding+border in width/height. | content-box | border-box |
| overflow | Controls what happens to overflowing content. | visible | hidden | scroll | auto | clip |
| overflow-x | Controls horizontal overflow. | visible | hidden | scroll | auto |
| overflow-y | Controls vertical overflow. | visible | hidden | scroll | auto |
| Property | Description | Values / Syntax |
|---|---|---|
| border | Shorthand: border-width, border-style, border-color. | width style color |
| border-width | Sets thickness of all four borders. | thin | medium | thick | length |
| border-style | Sets style of all borders. | none | solid | dashed | dotted | double | groove | ridge | inset | outset |
| border-color | Sets color of all four borders. | color | transparent |
| border-top | Shorthand for top border. | width style color |
| border-right | Shorthand for right border. | width style color |
| border-bottom | Shorthand for bottom border. | width style color |
| border-left | Shorthand for left border. | width style color |
| border-radius | Rounds corners. 50% creates a circle. | 0 | length | % (1-4 values) |
| border-collapse | For tables: collapse merges adjacent borders. | separate | collapse |
| border-spacing | Sets spacing between table cells (border-collapse: separate). | length |
| outline | Draws a line outside the border. Does not affect layout. | width style color |
| outline-offset | Adds space between element edge and outline. | length |
| Property | Description | Values / Syntax |
|---|---|---|
| display | Specifies the display type of an element. | block | inline | inline-block | flex | grid | none | contents | table | ... |
| position | Specifies the positioning method. | static | relative | absolute | fixed | sticky |
| top | For positioned elements: distance from the top. | auto | length | % |
| right | Distance from the right edge. | auto | length | % |
| bottom | Distance from the bottom edge. | auto | length | % |
| left | Distance from the left edge. | auto | length | % |
| z-index | Stacking order. Higher value = on top. Only works with positioned elements. | auto | integer |
| float | Takes element out of normal flow, floats to side. | none | left | right |
| clear | Prevents element from wrapping around floats. | none | left | right | both |
| visibility | hidden hides element but keeps space. | visible | hidden | collapse |
| clip-path | Clips element to a shape. | clip-source | basic-shape | border-box | ... |
| Property | Description | Values / Syntax |
|---|---|---|
| flex-direction | Direction of flex items in the container. | row | row-reverse | column | column-reverse |
| flex-wrap | Whether flex items wrap to next line. | nowrap | wrap | wrap-reverse |
| flex-flow | Shorthand for flex-direction and flex-wrap. | flex-direction flex-wrap |
| justify-content | Aligns items along main axis. | flex-start | flex-end | center | space-between | space-around | space-evenly |
| align-items | Aligns items along cross axis. | stretch | flex-start | flex-end | center | baseline |
| align-content | Aligns flex lines (multi-line containers). | stretch | flex-start | flex-end | center | space-between | space-around |
| gap | Shorthand for row-gap and column-gap in flex/grid. | length |
| flex | Shorthand for flex-grow, shrink, basis. | flex-grow flex-shrink flex-basis | auto | none |
| flex-grow | How much a flex item grows relative to siblings. | 0 | number |
| flex-shrink | How much a flex item shrinks relative to siblings. | 1 | number |
| flex-basis | Initial size of a flex item before growing/shrinking. | auto | length | % |
| align-self | Override align-items for a single flex item. | auto | flex-start | flex-end | center | baseline | stretch |
| order | Controls the order flex items appear in a container. | 0 | integer |
| Property | Description | Values / Syntax |
|---|---|---|
| grid-template-columns | Defines column tracks in a grid container. | none | track-list | auto | repeat() |
| grid-template-rows | Defines row tracks in a grid container. | none | track-list | auto | repeat() |
| grid-template-areas | Defines named grid areas for template-based layouts. | string (area names) |
| grid-template | Shorthand for grid-template-rows, -columns, -areas. | shorthand for rows/cols/areas |
| grid-column | Shorthand to place item across columns. | start / end |
| grid-row | Shorthand to place item across rows. | start / end |
| grid-column-gap | Gap between grid columns. Prefer column-gap. | length |
| grid-row-gap | Gap between grid rows. Prefer row-gap. | length |
| grid-auto-columns | Size of implicitly created column tracks. | auto | length | min-content | fr |
| grid-auto-rows | Size of implicitly created row tracks. | auto | length | min-content | fr |
| grid-auto-flow | Controls auto-placement algorithm. | row | column | row dense | column dense |
| place-items | Shorthand for align-items and justify-items in grid. | align-items justify-items |
| place-content | Shorthand for align-content and justify-content. | align-content justify-content |
| Property | Description | Values / Syntax |
|---|---|---|
| font | Shorthand for font properties. | style variant weight size/line-height family |
| font-family | Specifies the font. Use fallbacks: 'Arial', sans-serif. | family-name | generic-family |
| font-size | Size of the font. Use rem for accessibility. | medium | small | large | length | % |
| font-weight | Thickness of font characters. | normal | bold | 100-900 |
| font-style | Normal, italic, or oblique. | normal | italic | oblique |
| font-variant | small-caps displays lowercase as small uppercase. | normal | small-caps |
| line-height | Height between lines. Number (e.g. 1.6) is preferred. | normal | number | length | % |
| letter-spacing | Space between characters. | normal | length |
| word-spacing | Space between words. | normal | length |
| text-align | Horizontal alignment of inline content. | left | right | center | justify | start | end |
| text-align-last | How the last line of a block is aligned. | auto | left | right | center | justify |
| text-decoration | Shorthand for text decoration lines. | none | underline | overline | line-through |
| text-decoration-color | Color of the text decoration line. | color |
| text-decoration-style | Style of the text decoration. | solid | double | dotted | dashed | wavy |
| text-transform | Controls capitalization. | none | uppercase | lowercase | capitalize |
| text-indent | Indentation of the first line in a text block. | 0 | length | % |
| text-overflow | How overflowed text is signaled. Use with overflow:hidden. | clip | ellipsis |
| text-shadow | Adds shadow to text. | h-offset v-offset blur-radius color |
| white-space | Controls whitespace handling. | normal | nowrap | pre | pre-wrap | pre-line | break-spaces |
| word-break | Specifies where line breaks occur in long words. | normal | break-all | keep-all | break-word |
| word-wrap | Allows long words to break and wrap onto next line. | normal | break-word |
| direction | Text direction: left-to-right or right-to-left. | ltr | rtl |
| unicode-bidi | Used with direction property. | normal | embed | bidi-override |
| Property | Description | Values / Syntax |
|---|---|---|
| color | Sets the foreground color of text. | color-value |
| opacity | Transparency of an element (0 = invisible, 1 = opaque). | 0-1 |
| background | Shorthand for all background properties. | color position/size repeat attachment origin clip image |
| background-color | Sets the background color. | transparent | color |
| background-image | Sets one or more background images. | none | url() | gradient |
| background-repeat | Controls image repetition. | repeat | repeat-x | repeat-y | no-repeat | space | round |
| background-position | Position of the background image. | top left | center | x% y% | x y |
| background-size | cover fills, contain fits without cropping. | auto | cover | contain | length |
| background-attachment | fixed creates parallax effect. | scroll | fixed | local |
| background-origin | Where background image starts. | padding-box | border-box | content-box |
| background-clip | How far background extends. | border-box | padding-box | content-box | text |
| background-blend-mode | Blending of each background layer. | normal | multiply | screen | overlay | ... |
| Property | Description | Values / Syntax |
|---|---|---|
| transition | Shorthand for CSS transitions. | property duration timing-function delay |
| transition-property | Which property to transition. | all | none | property-name |
| transition-duration | Duration of the transition (e.g. 0.3s, 500ms). | 0s | time |
| transition-timing-function | Speed curve of transition. | ease | linear | ease-in | ease-out | ease-in-out | cubic-bezier() |
| transition-delay | Delay before transition starts. | 0s | time |
| animation | Shorthand for all animation properties. | name duration timing iteration direction fill-mode delay |
| animation-name | Name of @keyframes rule. | none | keyframe-name |
| animation-duration | Duration of one animation cycle. | 0s | time |
| animation-timing-function | Speed curve of animation. | ease | linear | steps() | cubic-bezier() |
| animation-iteration-count | Number of times animation plays. | 1 | infinite | number |
| animation-direction | Whether animation plays forwards, backwards, or alternates. | normal | reverse | alternate | alternate-reverse |
| animation-fill-mode | Styles applied before/after animation. | none | forwards | backwards | both |
| animation-play-state | Pause or resume animation via JS. | running | paused |
| animation-delay | Delay before animation begins. | 0s | time |
| Property | Description | Values / Syntax |
|---|---|---|
| transform | Applies 2D or 3D transformation. | none | transform-functions |
| transform-origin | Point around which transform is applied. | 50% 50% | x y z |
| transform-style | Whether children are in 3D space. | flat | preserve-3d |
| perspective | Distance of viewer from z=0 plane (3D). | none | length |
| perspective-origin | Position of the vanishing point for 3D perspective. | 50% 50% | x y |
| backface-visibility | Whether back face of element is visible when rotated. | visible | hidden |
| rotate | CSS property shorthand (CSS Transforms Level 2). | angle |
| scale | CSS property shorthand for scaling. | number |
| translate | CSS property shorthand for translation. | x y |
| Property | Description | Values / Syntax |
|---|---|---|
| --variable-name | Defines a custom property (CSS variable). Access via var(--name). | any CSS value |
| var() | References a CSS custom property value. | var(--name, fallback) |
| calc() | Performs calculations. Can mix units: calc(100% - 60px). | calc(expression) |
| min() | Returns smallest value. Responsive sizing: min(50%, 300px). | min(value, value) |
| max() | Returns largest value. | max(value, value) |
| clamp() | Clamps a value between min and max. Great for fluid typography. | clamp(min, val, max) |
| Property | Description | Values / Syntax |
|---|---|---|
| * | Selects all elements. | - (universal) |
| .class | Selects all elements with a given class. | - (class) |
| #id | Selects element with a specific ID. | - (id) |
| element | Selects all elements of a type. | - (type) |
| A, B | Selects all A and all B elements. | - (group) |
| A B | Selects B inside A (any depth). | - (descendant) |
| A > B | Selects B that is a direct child of A. | - (child) |
| A + B | Selects B immediately after A. | - (adjacent sibling) |
| A ~ B | Selects all B siblings after A. | - (general sibling) |
| :hover | Pointer is over the element. | - (pseudo-class) |
| :focus | Element has keyboard/click focus. | - (pseudo-class) |
| :active | Element is being activated (clicked). | - (pseudo-class) |
| :visited | Link has been visited. | - (pseudo-class) |
| :first-child | First child of parent. | - (structural) |
| :last-child | Last child of parent. | - (structural) |
| :nth-child(n) | Selects by index or formula. | n | even | odd | formula |
| :not(selector) | Elements not matching selector. | - (negation) |
| :is(A, B) | Matches any selector in the list (reduces specificity). | - (matches) |
| :where(A, B) | Like :is() but has zero specificity. | - (zero-specificity) |
| :has(B) | Parent selector: selects A if it contains B. | - (relational) |
| ::before | Inserts content before element via content property. | - (pseudo-element) |
| ::after | Inserts content after element via content property. | - (pseudo-element) |
| ::placeholder | Styles placeholder text in inputs. | - (pseudo-element) |
| [attr] | Selects elements with a given attribute. | - (attribute) |
| [attr=value] | Exact attribute value match. | - (attribute) |
| [attr*=value] | Attribute contains the value. | - (attribute) |
| [attr^=value] | Attribute value starts with. | - (attribute) |
| [attr$=value] | Attribute value ends with. | - (attribute) |
| Property | Description | Values / Syntax |
|---|---|---|
| filter | Applies graphical effects to an element. | blur() | brightness() | contrast() | drop-shadow() | grayscale() | hue-rotate() | invert() | opacity() | saturate() | sepia() |
| backdrop-filter | Applies filter to content behind element (glassmorphism). | blur() | brightness() | ... |
| mix-blend-mode | Blending of element with background. | normal | multiply | screen | overlay | darken | lighten | color-dodge | color-burn | ... |
| box-shadow | Adds shadow to element box. Use inset for inner shadow. | x y blur spread color | inset ... |
| Property | Description | Values / Syntax |
|---|---|---|
| @media | Applies CSS rules only when condition is met. | (max-width: ...) | print | screen | ... |
| @supports | Applies CSS only if feature is supported. | (property: value) |
| @keyframes | Defines animation sequence. | from {} to {} | 0% {} 100% {} |
| @import | Imports an external stylesheet. | url() | 'path' |
| @font-face | Defines custom font for use in page. | font-family: src: |
| @layer | Defines a cascade layer to control specificity order. | name { ... } |
| @container | Container queries - style based on parent size. | (min-width: ...) { } |