CSS Cheat Sheet
A searchable, printable CSS reference — selectors, the box model, flexbox, grid, typography, transitions and modern features. Free.
Selectors
13.class
#id
a, b
a b
a > b
a + b
a ~ b
[type="text"]
:hover :focus
:nth-child(2n)
::before ::after
:not(.x)
:is(h1, h2, h3)
Box model
7box-sizing: border-box;
margin: 0 auto;
padding: 1rem 2rem;
border: 1px solid #ccc;
border-radius: 8px;
outline: 2px dashed red;
overflow: hidden;
Flexbox
8display: flex;
flex-direction: row | column;
justify-content: space-between;
align-items: center;
flex-wrap: wrap;
gap: 1rem;
flex: 1;
align-self: flex-end;
Grid
8display: grid;
grid-template-columns: 1fr 1fr 1fr;
repeat(3, 1fr)
minmax(200px, 1fr)
grid-template-columns: repeat(auto-fill, minmax(200px,1fr));
gap: 1rem;
grid-column: 1 / 3;
place-items: center;
Typography
8font-family: system-ui, sans-serif;
font-size: 1.125rem;
font-weight: 600;
line-height: 1.6;
letter-spacing: .02em;
text-align: center;
text-transform: uppercase;
text-overflow: ellipsis;
Colors & background
7color: #1f2937;
background: rgb(0 0 0 / 50%);
background: linear-gradient(90deg,#f06,#48f);
opacity: .5;
box-shadow: 0 4px 12px rgb(0 0 0 / .15);
background-size: cover;
color-mix(in srgb, red 40%, blue);
Positioning
6position: relative;
position: absolute;
position: fixed;
position: sticky; top: 0;
inset: 0;
z-index: 10;
Transitions & animation
5transition: all .2s ease;
transform: translateY(-4px) scale(1.05);
@keyframes spin { to { transform: rotate(360deg); } }
animation: spin 1s linear infinite;
will-change: transform;
Responsive & modern
7@media (max-width: 768px) { ... }
clamp(1rem, 2vw, 2rem)
aspect-ratio: 16 / 9;
var(--brand)
:root { --brand: #4f46e5; }
container-type: inline-size;
@container (min-width: 400px) {…}
No entry matches “:q”.
About CSS Cheat Sheet
This CSS cheat sheet packs the properties you use daily into one searchable page: selectors, the box model, flexbox, grid, typography, colors and backgrounds, positioning, transitions and animation, and a section on responsive and modern CSS.
It is organized so the answer to “what was that property called?” is one search away — the flexbox and grid sections in particular list the alignment and layout properties with values you can copy straight into a stylesheet, and the modern section keeps newer features at hand.
The sheet is free, loads client-side, filters live as you type, and lets you copy any declaration with one click. A sticky table of contents jumps between sections and the print button produces a clean paper reference.
How to use CSS Cheat Sheet
- Skim the section list — Selectors, Box model, Flexbox, Grid, Typography and more.
- Type a property or concept like grid, hover or transition into the search box to filter every row.
- Jump to a section such as Positioning via the sticky table of contents.
- Click a snippet or its copy icon to copy the CSS declaration.
- Print the sheet for a desk-side CSS reference.