An "aspect ratio" is the ratio of an element's width to its height. It's most commonly used with images, but in CSS, it can apply to other things.
Either the width
or the height
of the element you're applying an aspect ratio to must be fixed, with the other one set to auto
, otherwise it won't work. If both are fixed
, or if both are set to auto
, it will result in unexpected behavior.
Quick Reference