Search
Type in the search box to filter snippets.
Everyday CSS selectors, flexbox, grid, and layout patterns with copy-ready snippetsFree CSS cheat sheet: 80+ copy-ready snippets for selectors, flexbox, grid, positioning, typography, and responsive design. Searchable and printable.
Everyday CSS selectors, flexbox, grid, and layout patterns with copy-ready snippets
74 of 74 entries shown. Click Copy on any snippet.
p { color: red; }.card { padding: 16px; }#header { height: 64px; }* { box-sizing: border-box; }article p { margin: 0; }ul > li { list-style: none; }h2 + p { margin-top: 0; }h2 ~ p { color: #555; }a[target="_blank"] { color: blue; }button:hover { background: #333; }input:focus { outline: 2px solid blue; }li:nth-child(2n) { background: #f5f5f5; }p:not(.intro) { opacity: 0.9; }.box { width: 300px; height: 200px; }.wrap { max-width: 1200px; margin: 0 auto; }.box { padding: 12px 16px; }.box { margin: 8px 12px 8px 12px; }.box { border: 1px solid #ddd; }.btn { border-radius: 8px; }* { box-sizing: border-box; }.card { box-shadow: 0 2px 8px rgba(0,0,0,0.1); }.scroll { overflow: auto; }.row { display: flex; }.col { display: flex; flex-direction: column; }.center { display: flex; align-items: center; justify-content: center; }.spread { display: flex; justify-content: space-between; }.grid { display: flex; flex-wrap: wrap; }.row { display: flex; gap: 16px; }.main { flex: 1; }.top { align-self: flex-start; }.first { order: -1; }.grid { display: grid; }.grid { display: grid; grid-template-columns: 1fr 1fr 1fr; }.grid { grid-template-columns: repeat(3, 1fr); }.grid { grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); }.grid { display: grid; gap: 20px; }.wide { grid-column: span 2; }.layout { grid-template-areas: "head head" "nav main"; }.header { grid-area: head; }.tip { position: relative; top: 4px; }.badge { position: absolute; top: 8px; right: 8px; }.nav { position: fixed; top: 0; left: 0; right: 0; }.toc { position: sticky; top: 16px; }.modal { position: fixed; z-index: 100; }.pop { position: absolute; top: 50%; left: 50%; transform: translate(-50%, -50%); }body { font-family: system-ui, -apple-system, sans-serif; }h1 { font-size: 2rem; }h1 { font-size: clamp(1.5rem, 4vw, 3rem); }strong { font-weight: 700; }p { line-height: 1.6; }.kicker { letter-spacing: 0.1em; }.hero { text-align: center; }.clip { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }.excerpt { display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }.brand { color: #2563eb; }.overlay { background: rgba(0, 0, 0, 0.5); }.accent { color: hsl(220, 90%, 55%); }.hero { background: linear-gradient(135deg, #667eea, #764ba2); }.banner { background: url("/img.jpg") center/cover no-repeat; }.faded { opacity: 0.6; }.btn { transition: background 0.2s ease; }.card { transition: transform 0.3s, box-shadow 0.3s; }@keyframes spin { to { transform: rotate(360deg); } }.loader { animation: spin 1s linear infinite; }.slide { transition-timing-function: cubic-bezier(0.4, 0, 0.2, 1); }.move { transform: translate(10px, 20px); }.zoom:hover { transform: scale(1.05); }.tilt { transform: rotate(-3deg); }.door { transform-origin: left center; }@media (max-width: 640px) { .grid { grid-template-columns: 1fr; } }@media (min-width: 768px) { .sidebar { display: block; } }@media (prefers-color-scheme: dark) { body { background: #111; color: #eee; } }@media (prefers-reduced-motion: reduce) { * { animation: none; } }@media print { .nav, .ads { display: none; } }Type in the search box to filter snippets.
Click Copy on any snippet to grab the code.
Print the page for a desk reference.
A field guide to the CSS you actually write day to day: selectors, the box model, flexbox, grid, positioning, typography, colors, transitions, transforms, and responsive media queries. Every entry is a tested snippet with a one-line explanation.
Use the search box to jump straight to what you need, copy snippets with one click, and print the page for an offline desk reference.

Free SSL certificate checker: verify any website's certificate issuer, expiry date, days remaining, covered domains and fingerprint. Avoid expiry outages.
Read article →
Free online DNS lookup tool. Check A, AAAA, MX, TXT, CNAME, NS and SOA records for any domain instantly. Fast, private, accurate, no sign-up required.
Read article →