Guide to CSS Properties

Well-structured CSS is the foundation of every modern web design. This curated CSS properties reference provides detailed guides for the most essential styling properties. Whether you need layout properties, typography controls, or visual effects, you'll find them categorized here with full usage guides.

Layout

display
The display property specifies the display behavior (the type of rendering box) of an element and its children.
Layout
position
The position property sets how an element is positioned in a document. The top, right, bottom, and left properties determine the final location of positioned elements.
Layout
gap
The gap property sets the gaps (gutters) between rows and columns in flexbox, CSS grid, and multi-column layouts.
Layout
z-index
The z-index property sets the stack order of a positioned element and its descendants.
Layout
overflow
The overflow property sets the desired behavior for content overflow of a block container element.
Layout

Flexbox

flex-direction
The flex-direction property sets how flex items are placed in the flex container defining the main axis and the direction (normal or reversed).
Flexbox
justify-content
The justify-content property defines how the browser distributes space between and around content items along the main axis of a flex or grid container.
Flexbox
align-items
The align-items property sets the align-self value on all direct children as a group along the cross axis of a flex or grid container.
Flexbox

Grid

grid-template-columns
The grid-template-columns property defines the line names and track sizing functions of CSS grid columns.
Grid

Box Model

margin
The margin shorthand property sets the margin area on all four sides of an element outside its border.
Box Model
padding
The padding shorthand property sets the padding area on all four sides of an element inside its border.
Box Model
border
The border shorthand property sets an element’s border width, style, and color in a single declaration.
Box Model
box-sizing
The box-sizing property sets how the total width and height of an element are calculated (including or excluding padding and border).
Box Model

Typography

color
The color property sets the foreground color value of an element’s text content and text decorations.
Typography
font-family
The font-family property specifies a prioritized list of one or more font family names and/or generic family names for the selected element.
Typography
font-size
The font-size property sets the size of the text font.
Typography
font-weight
The font-weight property sets the weight (or boldness) of the font.
Typography

Background

background-color
The background-color property sets the background color of an element.
Background

Visual

border-radius
The border-radius property rounds the corners of an element outer border edge.
Visual
box-shadow
The box-shadow property adds shadow effects around an element frame.
Visual
opacity
The opacity property sets the opacity level of an element (including its children).
Visual

Animation

transition
The transition shorthand property allows you to define the transition between two states of an element.
Animation
transform
The transform property lets you modify the coordinate space of the CSS visual formatting model (translate, rotate, scale, skew).
Animation