CSS reference

Quick reference pages for CSS selectors, display, the box model, Flexbox, Grid, position, typography, text, color, backgrounds, borders, and sizing and overflow. These pages complement the CSS tutorial; they do not replace it.

Use the tutorial for a short guided path, then open a reference page when you need syntax, initial values, conditions, and boundaries. Examples are complete HTML and CSS fragments checked with a CSS parser for structure. They were not rendered in a browser for these pages.

CSS tutorial overview →

TopicWhat it covers
SelectorsQuick reference for CSS selectors: common patterns, specificity, and the :is, :where, and :not rules, complementary to the CSS tutorial.
DisplayQuick reference for CSS display: outer and inner display roles, common keywords, and how display: none differs from visibility.
Box modelQuick reference for the CSS box model: box-sizing calculations, padding, border, margin, and when vertical margins collapse.
FlexboxQuick reference for CSS Flexbox: main and cross axes, default alignment, gap, and why flex items default to min-width: auto.
GridQuick reference for CSS Grid: track sizing, why 1fr is minmax(auto, 1fr), minmax(0, 1fr), and auto-fit versus auto-fill.
PositionQuick reference for CSS position: static, relative, absolute, sticky, and fixed, including sticky inset and overflow, and why absolute is not always relative to the parent.
TypographyQuick reference for CSS font families, font-size, line-height, the font shorthand, and the limits of font loading on this site.
TextQuick reference for CSS text-align, wrapping, overflow-wrap versus word-break, and the conditions required for text-overflow.
ColorsQuick reference for CSS color syntax, alpha, currentColor, and how opacity differs from a transparent color and from hiding interaction.
BackgroundsQuick reference for CSS background-color, layers, position, size, and using a gradient instead of a network image.
BordersQuick reference for CSS borders, border-radius, and outline, including layout size and focus visibility.
Sizing and overflowQuick reference for CSS width, height, min/max sizes, percentage heights and the containing block, and overflow including clip versus hidden.