The CSS reference for developers and their agents.
CSS never stops changing. You decide how it should look, and agents like Claude Code, Codex and Cursor write it. css.dev shows you both what works today: live demos for you, Markdown for them.
Live demos
Change a value and watch the boxes move
Many reference pages open on a playground like this one: real CSS in a real page, with the code below it rewritten as you change the controls.
.container { display: flex; flex-direction: row; justify-content: space-between; align-items: center; gap: 12px;}Learn
From the first rule to cascade layers
63 guides in 7 tracks. Each one teaches a single idea, with demos you change as you read.
Foundations
12 guidesLayout
16 guidesTypography
5 guidesResponsive design
5 guidesVisual effects and motion
9 guidesArchitecture
9 guidesBuilding interfaces
7 guides
Reference
One page for each feature
Each page has the syntax, every value, worked examples, common mistakes and browser support.
Properties
262Layout, sizing, text, color, effects and animation.
Basic selectors, combinators, pseudo-classes, pseudo-elements.
At-rules
36Media and container queries, layers, fonts, keyframes.
Math, color, gradients, shapes, transforms, easing.
Values
48Units, data types, colors and global keywords.
New in CSS
What browsers have shipped lately
Features browsers added in the last few years, each with a page that says what it does and where it works.
- :has()Matches an element if the selector inside the parentheses matches something relative to it: a child, a descendant, or a sibling that follows.Widely available
- @containerApplies a block of CSS when an ancestor container matches a condition, such as its width, so a component adapts to the space it is given, not to the viewport.Widely available
- Nesting selectorStands for the elements the parent rule matches, inside a rule nested in it:
&:hoverin.btn { }means.btn:hover, and.dark &means.dark .btn.Widely available - @layerGroups rules into cascade layers whose order decides conflicts before specificity does: a rule in a later layer beats any rule in an earlier one.Widely available
- oklch()Writes a color as perceived lightness, chroma and hue, so equal lightness looks equal across hues and colors beyond sRGB are in reach.Widely available
- color-mix()Blends two colors in the color space you name, in the proportions you give, which turns one color token into tints, shades and see-through variants.Widely available
- text-wrapSets whether text wraps and how breaks are chosen:
balanceevens out a headline's lines,prettyavoids a lonely last word in a paragraph.Widely available - @starting-styleGives an element a style to transition from the first time it is drawn, so it can fade or slide in as it appears, even out of display: none.Newly available
- position-areaPlaces an anchor-positioned element in a cell or span of an invisible three-by-three grid around its anchor: above it, below and to the right, or a whole row.Newly available
- animation-timelineChooses what drives an animation's progress: the clock, as usual, or a scroll position, so the keyframes follow a scroller or an element crossing the screen.Newly available
- light-dark()Returns its first color when the element uses a light color scheme and its second when it uses a dark one, so one declaration covers both themes.Newly available
- @scopeLimits a set of rules to one part of the page: inside a root element and, if you say so, not past a boundary, with the nearest root winning ties.Newly available
Tailwind CSS
CSS and Tailwind side by side
Each property with Tailwind utilities has a Tailwind tab: its classes, the CSS each one compiles to (generated by Tailwind itself), and demos rebuilt with utilities where they translate.
CSS
.card { display: flex; align-items: center; gap: 1rem; padding: 1.5rem; border-radius: 0.75rem; background-color: white; box-shadow: 0 1px 3px rgb(0 0 0 / 0.1); } .card:hover { box-shadow: 0 10px 15px rgb(0 0 0 / 0.1); }
Tailwind
<div class="flex items-center gap-4 rounded-xl bg-white p-6 shadow-sm hover:shadow-lg" > … </div>
FAQ
Questions
What the site is, what it costs and where its data comes from.
What is css.dev?
A CSS reference and a set of guides where every idea comes with a demo you can change. Each page covers one property, selector, function, at-rule or value: what it does, every value it takes, worked examples, the mistakes people make, and where it works.
Is css.dev free?
Yes. Every page, demo and guide is free to read, with no account.
I'm new to CSS. Where do I start?
Start with the Learn section. The Foundations track goes in order from what CSS is to the cascade, the box model and units, and each guide assumes only the ones before it. When a guide mentions a property, its name links to the reference page.
Where does the browser support data come from?
The support table and the Baseline status on each page are generated from MDN's browser-compat-data and the web-features project, the open data behind MDN's own compatibility tables and Baseline badges. A property's formal definition comes from MDN's data too. They are refreshed with the site, not written by hand.
How does the Tailwind part work?
Every CSS property that has utilities in Tailwind has a Tailwind tab: the classes, the exact CSS each one produces (compiled by Tailwind itself, not copied from a table), and the page's demos rebuilt with utilities where they translate. The Tailwind section also has guides to the ideas behind utilities, starting from the CSS.
Can my AI coding assistant read css.dev?
Yes. Every page is also plain Markdown at its address plus .md, and /llms.txt lists them all with one line each, so an assistant can read exactly what you would.
New to CSS: start with the first guide
The Foundations track begins at what CSS is and goes in order, each guide building on the ones before it.