← Back to home

CSS Properties

Browse all CSS properties with syntax, examples, and practical developer notes.

25 properties

align-items

Aligns flex items along the cross axis.

Flexbox

background-color

Sets the background color of an element.

Backgrounds

border-radius

Rounds the corners of an element's border.

Borders

box-sizing

Controls whether padding and border are included in an element's total width and height.

Sizing

color

Sets the foreground color of an element's text and text decorations.

Typography

cursor

Sets the mouse cursor appearance when hovering over an element.

UI

display

Sets how an element participates in layout, including block, inline, flex, grid, or none.

Layout

flex-direction

Sets the direction of the main axis in a flex container.

Flexbox

font-size

Sets the size of the font for an element.

Typography

font-weight

Sets the weight (boldness) of the font.

Typography

gap

Sets the spacing between rows and columns in flex and grid containers.

Spacing

grid-template-columns

Defines the column track sizes in a grid container.

Grid

height

Sets the height of an element's content area.

Sizing

justify-content

Aligns flex or grid items along the main axis.

Flexbox

line-height

Sets the height of a line box, controlling the space between lines of text.

Typography

margin

Sets the space outside an element's border, separating it from neighboring elements.

Spacing

max-width

Sets the maximum width an element can grow to.

Sizing

opacity

Sets the transparency level of an element and all its children.

Visibility

overflow

Controls what happens when content overflows its container.

Visibility

padding

Sets the space between an element's content and its border.

Spacing

position

Defines how an element is positioned and how it interacts with normal document flow (static, relative, absolute, fixed, sticky).

Positioning

transform

Applies 2D or 3D transformations like rotation, scaling, or translation to an element.

Animation

transition

Animates property changes smoothly over a specified duration.

Animation

width

Sets the width of an element's content area.

Sizing

z-index

Controls the stacking order of positioned elements.

Positioning