Skip to main content Accessibility Feedback

CSS one-liners

My friend Steph Eckles recently shared her 12 favorite CSS one-liners.

She starts right off with one of my favorites, the aspect-ratio property…

Have you ever used the “padding hack” to force an aspect ratio such as 16:9 for video embeds? As of September 2021, the aspect-ratio property is stable in evergreen browsers and is the only property needed to define an aspect ratio.

The article includes a ton of useful stuff, including a handful of things I didn’t know about. Go check it out!