CSS Properties

Selectors

elementSelect all <element> tags
.classSelect by class name
#idSelect by unique ID
A BDescendant selector (B inside A)
A > BDirect child selector
A + BAdjacent sibling (next)
A ~ BGeneral sibling selector
[attr="val"]Attribute value selector
:hoverMouse hover state
:focusFocused element
:nth-child(n)Nth child element
::before / ::afterInsert pseudo-content

Box Model

width / heightElement dimensions
marginSpace outside the border
paddingSpace inside the border
borderBorder around element
box-sizing: border-boxInclude padding in width
max-width / min-widthWidth constraints
overflowHandle content overflow
outlineNon-layout border (focus rings)

Display & Position

display: blockFull-width block element
display: inlineInline flow element
display: inline-blockInline with block features
display: noneRemove from layout
display: flexFlexbox container
display: gridGrid container
position: staticDefault normal flow
position: relativeOffset from normal position
position: absoluteRelative to positioned parent
position: fixedFixed to viewport
position: stickySticky within scroll
z-indexStack order (higher = on top)

Flexbox

flex-directionrow | column | row-reverse
justify-contentMain axis alignment
align-itemsCross axis alignment
flex-wrapWrap items to new lines
gapSpace between flex items
flex: 1Grow to fill available space
flex-shrinkShrink factor when tight
align-selfOverride align for one item
orderChange visual order

Grid

grid-template-columnsDefine column sizes
grid-template-rowsDefine row sizes
grid-gap / gapSpace between grid cells
grid-columnColumn start / end span
grid-rowRow start / end span
grid-areaNamed area placement
grid-template-areasNamed grid layout map
repeat(n, size)Repeat column/row pattern
frFractional unit of space
minmax(min, max)Size range constraint

Typography

font-familyFont stack (fallbacks)
font-sizeText size (px, rem, em)
font-weightBold (100-900)
line-heightVertical line spacing
text-alignleft | center | right
text-decorationUnderline, strikethrough
text-transformuppercase | lowercase | capitalize
letter-spacingSpace between characters
word-spacingSpace between words
white-spaceWhitespace handling (nowrap)
text-overflow: ellipsisTruncate with "..."

Colors & Background

colorText color
background-colorBackground fill color
background-imageImage or gradient bg
background-sizecover | contain | custom
background-positionPosition within element
opacityTransparency (0 to 1)
rgba(r,g,b,a)Color with alpha channel
linear-gradient()Linear color gradient

Transforms & Animations

transform: translate()Move element X/Y
transform: scale()Resize element
transform: rotate()Rotate element (deg)
transitionAnimate property changes
transition-durationAnimation time (ms/s)
animationKeyframe animation shorthand
@keyframesDefine animation steps
border-radiusRounded corners
box-shadowDrop shadow on element
filterBlur, brightness, grayscale

Responsive Design

@media (max-width)Styles below breakpoint
@media (min-width)Styles above breakpoint
vw / vhViewport width/height units
rem / emRelative size units
clamp(min, pref, max)Fluid sizing
@containerContainer query
aspect-ratioWidth to height ratio
object-fitImage fit inside container
allprintabledoc.com