CSS Properties Reference

Comprehensive reference of all major CSS properties

About This Reference

This comprehensive reference lists all major CSS properties organized by category. Properties are the fundamental building blocks of CSS - they define how elements should look and behave. Each property controls a specific aspect of an element's appearance, layout, or interaction.

Each property includes a description of its purpose and a link to the official W3C specification. Click section headings to view related tutorials with practical examples.

Layout & Display

Property Description Links
display Controls element's display behavior (block, inline, flex, grid, etc.)
position Sets positioning method (static, relative, absolute, fixed, sticky)
top Sets top offset for positioned elements
right Sets right offset for positioned elements
bottom Sets bottom offset for positioned elements
left Sets left offset for positioned elements
inset Shorthand for top, right, bottom, left
inset-block Logical property for vertical offsets
inset-inline Logical property for horizontal offsets
float Floats element left or right
clear Controls clearing of floated elements
z-index Sets stacking order of positioned elements
overflow Controls content overflow behavior
overflow-x Controls horizontal overflow
overflow-y Controls vertical overflow
visibility Controls element visibility (visible, hidden, collapse)
aspect-ratio Sets preferred aspect ratio for element
contain Controls containment of layout, style, paint, size
content-visibility Controls rendering behavior for performance optimization
block-size Logical property for height (in horizontal writing mode)
inline-size Logical property for width (in horizontal writing mode)
max-block-size Logical property for max-height
max-inline-size Logical property for max-width
min-block-size Logical property for min-height
min-inline-size Logical property for min-width
object-fit Controls how replaced content (images/video) fits container
object-position Sets position of replaced element's content
overlay Controls top layer positioning
anchor-name Names element as anchor for anchor positioning
position-anchor Associates positioned element with anchor
position-area Positions element relative to anchor in grid areas

Flexbox

Property Description Links
flex Shorthand for flex-grow, flex-shrink, and flex-basis
flex-grow Defines flex item's ability to grow
flex-shrink Defines flex item's ability to shrink
flex-basis Defines default size of flex item
flex-direction Sets main axis direction (row, column, reverse)
flex-wrap Controls wrapping of flex items
flex-flow Shorthand for flex-direction and flex-wrap
justify-content Aligns items along main axis
align-items Aligns items along cross axis
align-self Overrides align-items for individual item
align-content Aligns flex lines when there's extra space
gap Shorthand for row-gap and column-gap
row-gap Sets gap between rows
column-gap Sets gap between columns
order Controls order of flex items

Grid Layout

Property Description Links
grid Shorthand for all grid properties
grid-template Shorthand for rows, columns, and areas
grid-template-columns Defines grid column tracks
grid-template-rows Defines grid row tracks
grid-template-areas Defines named grid areas
grid-area Places item in named area or coordinates
grid-row Shorthand for grid-row-start and grid-row-end
grid-row-start Sets item's row start position
grid-row-end Sets item's row end position
grid-column Shorthand for grid-column-start and grid-column-end
grid-column-start Sets item's column start position
grid-column-end Sets item's column end position
grid-auto-flow Controls auto-placement algorithm
grid-auto-rows Sets size of implicit rows
grid-auto-columns Sets size of implicit columns
place-items Shorthand for align-items and justify-items
place-content Shorthand for align-content and justify-content
place-self Shorthand for align-self and justify-self

Box Model

Property Description Links
width Sets element's width
height Sets element's height
min-width Sets minimum width
min-height Sets minimum height
max-width Sets maximum width
max-height Sets maximum height
margin Shorthand for all margin properties
margin-top Sets top margin
margin-right Sets right margin
margin-bottom Sets bottom margin
margin-left Sets left margin
margin-block Logical property for vertical margins
margin-inline Logical property for horizontal margins
padding Shorthand for all padding properties
padding-top Sets top padding
padding-right Sets right padding
padding-bottom Sets bottom padding
padding-left Sets left padding
padding-block Logical property for vertical padding
padding-inline Logical property for horizontal padding
box-sizing Controls how width/height are calculated

Typography

Property Description Links
font Shorthand for all font properties
font-family Sets font family
font-size Sets font size
font-weight Sets font weight (boldness)
font-style Sets font style (normal, italic, oblique)
font-variant Controls font variants
line-height Sets line height (leading)
letter-spacing Sets spacing between characters
word-spacing Sets spacing between words
text-align Sets horizontal text alignment
text-align-last Aligns last line of text
text-decoration Shorthand for text decoration properties
text-decoration-line Sets decoration line type (underline, overline, line-through)
text-decoration-color Sets decoration line color
text-decoration-style Sets decoration line style (solid, wavy, dashed, dotted)
text-decoration-thickness Sets decoration line thickness
text-underline-offset Sets offset distance of underline
text-transform Controls text capitalization
text-indent Sets first-line indentation
text-shadow Adds shadow to text
text-overflow Controls how overflowed text is displayed
text-wrap Controls text wrapping behavior (balance, pretty)
white-space Controls white space handling
word-break Controls word breaking
word-wrap Controls word wrapping (alias for overflow-wrap)
hyphens Controls hyphenation
vertical-align Sets vertical alignment
line-clamp Limits text to specified number of lines
text-wrap-mode Controls text wrapping mode (wrap, nowrap)
text-wrap-style Controls text wrapping style (auto, balance, stable, pretty)
hanging-punctuation Controls hanging punctuation
hyphenate-character Sets hyphen character
hyphenate-limit-chars Sets minimum word length for hyphenation
initial-letter Creates drop caps effect
text-spacing-trim Trims spacing around CJK punctuation
text-autospace Adds spacing between CJK and Latin characters
text-size-adjust Controls text size inflation on mobile

Colors & Backgrounds

Property Description Links
color Sets text color
opacity Sets element opacity (0-1)
background Shorthand for all background properties
background-color Sets background color
background-image Sets background image
background-position Sets background image position
background-size Sets background image size
background-repeat Controls background image repetition
background-attachment Sets background scroll behavior
background-origin Sets background positioning area
background-clip Sets background painting area
background-blend-mode Blends background layers
color-scheme Indicates color schemes element can render in (light, dark)
forced-color-adjust Controls forced colors mode behavior
print-color-adjust Controls color adjustments for printing

Borders & Outlines

Property Description Links
border Shorthand for all border properties
border-width Sets border width for all sides
border-style Sets border style for all sides
border-color Sets border color for all sides
border-top Shorthand for top border
border-right Shorthand for right border
border-bottom Shorthand for bottom border
border-left Shorthand for left border
border-radius Rounds border corners
border-top-left-radius Rounds top-left corner
border-top-right-radius Rounds top-right corner
border-bottom-left-radius Rounds bottom-left corner
border-bottom-right-radius Rounds bottom-right corner
border-image Shorthand for border-image properties
border-collapse Controls table border collapsing
border-spacing Sets spacing between table borders
outline Shorthand for outline properties
outline-width Sets outline width
outline-style Sets outline style
outline-color Sets outline color
outline-offset Sets space between outline and border

Transforms & Animations

Property Description Links
transform Applies 2D or 3D transformations
transform-origin Sets transformation origin point
transform-style Sets 3D rendering context
perspective Sets perspective for 3D transforms
perspective-origin Sets perspective origin point
backface-visibility Controls visibility of back face
transition Shorthand for transition properties
transition-property Sets properties to transition
transition-duration Sets transition duration
transition-timing-function Sets transition easing function
transition-delay Sets transition delay
animation Shorthand for animation properties
animation-name Sets keyframe animation name
animation-duration Sets animation duration
animation-timing-function Sets animation easing function
animation-delay Sets animation delay
animation-iteration-count Sets number of animation iterations
animation-direction Sets animation playback direction
animation-fill-mode Sets styles before/after animation
animation-play-state Controls animation running/paused state
offset Shorthand for motion path properties
offset-path Defines the motion path an element follows
offset-distance Position along the motion path (0% to 100%)
offset-rotate Rotation of element along the motion path
offset-anchor Point within element attached to the path

Scroll & View Animations

Property Description Links
animation-timeline Specifies timeline that controls animation progress
animation-range Shorthand for animation-range-start and animation-range-end
animation-range-start Sets start of animation attachment range
animation-range-end Sets end of animation attachment range
scroll-timeline Shorthand for scroll-timeline-name and scroll-timeline-axis
scroll-timeline-name Names a scroll timeline
scroll-timeline-axis Sets scroll timeline axis (block, inline, x, y)
view-timeline Shorthand for view-timeline-name and view-timeline-axis
view-timeline-name Names a view progress timeline
view-timeline-axis Sets view timeline axis
view-timeline-inset Adjusts view timeline start/end points
timeline-scope Declares scope of named timelines
view-transition-name Names element for view transitions
view-transition-class Adds classes to view transition pseudo-elements

Visual Effects

Property Description Links
box-shadow Adds shadow to element box
filter Applies visual effects (blur, brightness, contrast, etc.)
backdrop-filter Applies filter effects to backdrop
mix-blend-mode Blends element with backdrop
clip-path Clips element to specific shape
mask Shorthand for mask properties
mask-image Sets mask layer image
mask-size Sets mask layer size
mask-position Sets mask layer position

Lists & Tables

Property Description Links
list-style Shorthand for list-style properties
list-style-type Sets list item marker type
list-style-position Sets marker position (inside, outside)
list-style-image Sets custom marker image
table-layout Controls table layout algorithm
caption-side Sets table caption position
empty-cells Controls display of empty table cells

User Interface

Property Description Links
cursor Sets cursor style
pointer-events Controls pointer interaction
user-select Controls text selection
resize Controls element resizability
scroll-behavior Controls scroll behavior (smooth, auto)
scroll-margin Sets scroll snap margin
scroll-padding Sets scroll snap padding
scroll-snap-type Defines scroll snap behavior
scroll-snap-align Sets snap alignment
scroll-snap-stop Controls scroll snap stopping
overscroll-behavior Controls overscroll behavior
touch-action Controls touch gesture behavior
caret-color Sets text input caret color
accent-color Sets accent color for form controls
appearance Controls native appearance of UI controls
scrollbar-width Sets scrollbar width (auto, thin, none)
scrollbar-color Sets scrollbar thumb and track colors
scrollbar-gutter Reserves space for scrollbar gutter
field-sizing Controls form field sizing behavior CSS UI 4

Multi-Column Layout

Property Description Links
columns Shorthand for column-width and column-count
column-count Sets number of columns
column-width Sets optimal column width
column-gap Sets gap between columns
column-rule Shorthand for column-rule properties
column-rule-width Sets column rule width
column-rule-style Sets column rule style
column-rule-color Sets column rule color
column-span Controls column spanning
column-fill Controls column balance
break-before Controls page/column break before element
break-after Controls page/column break after element
break-inside Controls page/column break inside element
orphans Minimum lines at bottom of page/column before break
widows Minimum lines at top of page/column after break

Container Queries

Property Description Links
container Shorthand for container-type and container-name
container-type Establishes element as query container
container-name Names a query container

Custom Properties & Functions

Property Description Links
--custom-property Defines custom CSS variable
var() Uses custom property value
calc() Performs calculations
min() Returns minimum value
max() Returns maximum value
clamp() Clamps value between min and max

Generated Content

Property Description Links
content Generates content with ::before/::after
counter-reset Creates or resets counter
counter-increment Increments counter value
quotes Sets quotation marks for content

Resources & Tools

Demo