CSS cheat sheet
The 154 properties you will use most, on one page. The everyday ones come first. Print it, or keep it open beside your editor.
Everyday 56
align-items- Lines up flex or grid children along the cross axis.
animation- Shorthand that sets a keyframe animation's name, timing, repeats and more.
animation-duration- How long one cycle of an animation takes.
animation-name- Which @keyframes rule the element plays.
background- Shorthand for all background settings: color, image, position, size and repeat.
background-color- Solid color painted behind the element's content.
background-image- One or more images or gradients drawn behind the content.
background-position- Where a background image sits inside the element.
background-repeat- Whether and how a background image tiles.
background-size- How big a background image is drawn, such as cover or contain.
border- Shorthand for border width, style and color on all four sides.
border-color- Color of the border on all sides.
border-radius- Rounds the element's corners.
border-style- Line style of the border, such as solid, dashed or dotted.
border-width- Thickness of the border on all sides.
bottom- Offset of a positioned element from the bottom edge.
box-shadow- Adds one or more shadows around the element's box.
box-sizing- Whether width and height include padding and border.
color- Color of the text.
cursor- Mouse pointer shown when hovering the element.
display- How an element is laid out: block, inline, flex, grid, none and more.
flex- Shorthand for how a flex item grows, shrinks and its starting size.
flex-direction- Lays flex items out in a row or a column.
flex-wrap- Lets flex items wrap onto new lines.
font-family- Which typefaces to use, in order of preference.
font-size- Size of the text.
font-style- Makes text italic or normal.
font-weight- How bold the text is.
gap- Space between rows and columns in flex and grid layouts.
grid-template-columns- Number and widths of the grid's columns.
height- Height of the element.
justify-content- Spreads flex or grid items along the main axis.
left- Offset of a positioned element from the left edge.
line-height- Height of each line of text.
margin- Space outside the border on all sides.
margin-bottom- Space outside the element's bottom border.
margin-left- Space outside the element's left border.
margin-right- Space outside the element's right border.
margin-top- Space outside the element's top border.
max-width- Largest width the element may grow to.
opacity- How transparent the whole element is, from 0 to 1.
overflow- What happens to content too big for its box: show, hide or scroll.
padding- Space between the content and the border on all sides.
padding-bottom- Space between the content and the bottom border.
padding-left- Space between the content and the left border.
padding-right- Space between the content and the right border.
padding-top- Space between the content and the top border.
position- Positioning method: static, relative, absolute, fixed or sticky.
right- Offset of a positioned element from the right edge.
text-align- Horizontal alignment of text: left, right, center or justified.
text-decoration- Shorthand for underlines, overlines and line-throughs.
top- Offset of a positioned element from the top edge.
transform- Moves, rotates, scales or skews the element visually.
transition- Shorthand for animating property changes smoothly.
width- Width of the element.
z-index- Stacking order of positioned elements; higher appears on top.
Also useful 98
accent-color- Tint color for checkboxes, radio buttons, sliders and progress bars.
align-content- Distributes rows of items along the cross axis when there is extra space.
align-self- Overrides align-items for a single flex or grid child.
animation-delay- Waiting time before an animation starts.
animation-direction- Plays an animation forwards, backwards, or alternating each cycle.
animation-fill-mode- Whether animation styles apply before it starts or stay after it ends.
animation-iteration-count- How many times an animation repeats, or infinite.
animation-play-state- Pauses or resumes a running animation.
animation-timing-function- Speed curve of an animation, such as ease-in or linear.
appearance- Removes or keeps the browser's built-in look for form controls.
backdrop-filter- Blurs or tints whatever is visible behind the element.
background-clip- How far the background extends: border, padding, content, or the text itself.
block-size- Size in the block direction; equals height in horizontal text.
border-bottom-color- Color of the bottom border.
border-bottom-left-radius- Rounds the bottom-left corner.
border-bottom-right-radius- Rounds the bottom-right corner.
border-bottom-style- Line style of the bottom border, like solid or dashed.
border-bottom-width- Thickness of the bottom border.
border-left-color- Color of the left border.
border-left-style- Line style of the left border.
border-left-width- Thickness of the left border.
border-right-color- Color of the right border.
border-right-style- Line style of the right border.
border-right-width- Thickness of the right border.
border-top-color- Color of the top border.
border-top-left-radius- Rounds the top-left corner.
border-top-right-radius- Rounds the top-right corner.
border-top-style- Line style of the top border.
border-top-width- Thickness of the top border.
caret-color- Color of the blinking text cursor in inputs.
clip-path- Cuts the element to a shape, hiding everything outside it.
column-gap- Space between columns in grid, flex or multi-column layouts.
container- Shorthand that names an element and makes it a query container.
container-name- Names a container so container queries can target it.
container-type- Makes an element a container whose size children can query.
content- Text or image inserted by ::before and ::after.
filter- Applies effects like blur, brightness or grayscale to the element.
flex-basis- Starting size of a flex item before space is shared out.
flex-flow- Shorthand for flex-direction and flex-wrap.
flex-grow- How much a flex item expands to fill spare space.
flex-shrink- How much a flex item shrinks when space runs out.
font- Shorthand for font style, weight, size, line height and family.
font-variant-numeric- Number styles such as equal-width digits or fractions.
grid-area- Places an item in a named area or row and column range.
grid-auto-flow- Whether auto-placed items fill rows or columns, and packs gaps.
grid-auto-rows- Height of rows the grid creates automatically.
grid-column- Which columns a grid item spans.
grid-row- Which rows a grid item spans.
grid-template-areas- Draws the layout by naming regions of the grid.
grid-template-rows- Number and heights of the grid's rows.
inline-size- Size in the inline direction; equals width in horizontal text.
inset- Shorthand for top, right, bottom and left.
justify-items- Aligns grid items horizontally inside their cells.
justify-self- Aligns one grid item horizontally inside its cell.
letter-spacing- Extra space between letters.
list-style- Shorthand for list marker type, image and position.
list-style-type- Marker style for list items, like disc, decimal or none.
margin-inline- Margins on both inline sides, left and right in horizontal text.
max-height- Largest height the element may grow to.
min-height- Smallest height the element may shrink to.
min-width- Smallest width the element may shrink to.
object-fit- How an image or video fills its box: cover, contain and so on.
object-position- Where an image or video sits inside its box.
order- Changes the visual order of a flex or grid item.
outline- Line drawn outside the border without taking up space, often for focus.
outline-offset- Gap between the outline and the border.
overflow-wrap- Breaks long words or URLs that would overflow the line.
overflow-x- What happens to content that overflows left or right.
overflow-y- What happens to content that overflows top or bottom.
overscroll-behavior- Stops scrolling from passing to the page at a box's edge.
padding-inline- Padding on both inline sides, left and right in horizontal text.
place-content- Shorthand for align-content and justify-content.
place-items- Shorthand for align-items and justify-items, handy for centering.
pointer-events- Whether the element responds to clicks and hovers.
rotate- Rotates the element without using transform.
row-gap- Space between rows in grid or flex layouts.
scale- Grows or shrinks the element without using transform.
scroll-behavior- Makes in-page jumps scroll smoothly instead of instantly.
scroll-margin- Extra space kept around an element when scrolled into view.
scroll-padding- Inner offset of a scroll container when snapping or jumping.
text-decoration-color- Color of an underline or other text line.
text-decoration-line- Which line to draw: underline, overline or line-through.
text-indent- Indents the first line of a block of text.
text-overflow- Shows an ellipsis when single-line text is cut off.
text-shadow- Adds shadows behind text.
text-transform- Changes text to uppercase, lowercase or capitalized.
text-wrap- How lines wrap, including balanced headings and pretty paragraphs.
transform-origin- The point a transform rotates or scales around.
transition-delay- Waiting time before a transition starts.
transition-duration- How long a transition takes.
transition-property- Which properties animate when they change.
transition-timing-function- Speed curve of a transition, such as ease-out.
translate- Moves the element without using transform.
user-select- Whether the user can select the text.
vertical-align- Vertical alignment of inline content or table cell contents.
visibility- Hides an element while keeping its space.
white-space- How spaces and line breaks in the text are handled.
word-break- Where lines may break inside words.
PlainFinch CSS cheat sheet · plainfinch.com/css/cheat-sheet/ · version 3.25.2