CSS
Tailwind CSS Cheat Sheet — Utility Class Reference
The Tailwind utility classes you reach for most, grouped by what they style.
Put it into practice with the matching tool.
Try the layout playground →Advertisement
Layout & display
block / inline-block / hiddenDisplay typeflex / gridFlexbox or grid containerrelative / absolute / fixedPositioninginset-0Pin to all four edgesz-10Stacking orderoverflow-hidden / overflow-autoClip or scroll overflowSpacing & sizing
p-4 / px-4 / pt-4Padding: all / horizontal / topm-4 / mx-autoMargin: all / center horizontallygap-4Gap between flex or grid childrenspace-y-4Vertical space between childrenw-full / w-1/2 / w-screenWidthh-full / min-h-screenHeightmax-w-2xlConstrain max width (good for text)Flex & grid
flex-col / flex-rowFlex directionitems-centerAlign items on the cross axisjustify-between / justify-centerDistribute along the main axisflex-1 / shrink-0Grow to fill / never shrinkflex-wrapAllow wrappinggrid-cols-3Three equal grid columnscol-span-2Span two columnsTypography
text-sm / text-lg / text-2xlFont sizefont-medium / font-boldFont weighttext-center / text-rightText alignmentleading-relaxedLine heighttracking-tightLetter spacingtruncate / line-clamp-2Clip overflowing textColors & borders
text-neutral-700Text colorbg-white / bg-blue-600Background colorborder / border-2Border widthborder-neutral-200Border colorrounded-lg / rounded-fullBorder radiusshadow-sm / shadow-lgBox shadowopacity-50OpacityVariants
sm: md: lg: xl:Responsive breakpoints (mobile-first)hover: / focus: / active:Interaction statesdark:Dark modedisabled:Disabled stategroup-hover:React to a parent marked with groupfirst: / last: / odd:Position-based variants