5 CSS Features That Replace the Old Hacks

Five everyday jobs, each done by one CSS feature: space between cards, a heading that fits every screen, a photo box that keeps its shape, a card styled by what's inside it, and one thing centered in a box. From the blog post [5 CSS features that replace the old hacks](/blog/five-css-features-that-replace-the-old-hacks).

By

Updated

Cheat sheet: 5 CSS Features That Replace the Old Hacks. Five numbered boxes: gap, clamp(), aspect-ratio, :has() and place-items: center, each with one line of code and a small diagram.
Category
CSS
Level
Journeyman
Tags
:has(), Aspect ratio, clamp(), CSS, Gap, place-items