Aspect-ratio card
Media card with consistent ratio and object-fit.
CSS layout snippets: grid, flexbox, centering, positioning, and responsive patterns. Every snippet includes a live demo, copyable CSS, and an LLM-ready prompt.
Media card with consistent ratio and object-fit.
The RAM pattern: repeat(auto-fill, minmax()) for grids that adapt without media queries.
The simplest CSS centering technique: one line of grid + place-items.
Cards that respond to container width with @container.
The classic holy grail layout with header, two sidebars, content, and footer using CSS Grid template areas.
The classic media object pattern with image on the left and text on the right using flexbox and object-fit.
A table that stacks into card-like rows on small screens using container queries and data-label attributes.
A horizontal scrolling gallery that snaps to each image using scroll-snap.
A sidebar alongside main content using CSS Grid fit-content.
A sticky footer that stays at the bottom of the viewport even with short content.
Aligned grid children with CSS subgrid — no fixed heights.