Skip to main content

Max Glenister

Great use of CSS variables to set inheritable aspect ratio styles!

"Building a combined CSS-aspect-ratio-grid" https://9elements.com/blog/combined-aspect-ratio-grid/

Building a combined CSS-aspect-ratio-grid
Recently I was faced with the following problem. I had to build a layout that consists of several rows. In each row are two images with a fixed aspect ratio. The two images should have the same height and fill the entire row.