Creating an aspect ratio CSS utility

/ filed under HTML & CSS

Until we get a native aspect ratio unit in the browser: achieving a controlled height based on a container’s width might seem difficult in a responsive design at first glance. It is actually pretty darn trivial, thanks to good ol’ padding and a touch of positioning magic

Join thousands of product people and get the latest articles and resources from my curation every day or week.