If you want an element to have the aspect ratio 16:9 give it a parent div with width: 100%; height: 0; padding-bottom: 56.25%; position: relative;
then just absolutely position the child element with width 100%; height:100%;
This works everywhere, even in IE8. I am happy I will not have to resort to this anymore in the future, but it will do for now.
It will use the property "aspect-ratio" with values like "16/9" or "1/1".
MDN: https://developer.mozilla.org/en-US/docs/Web/CSS/aspect-rati...
Article about it by Rachel Andrew in Smashing Magazine: https://www.smashingmagazine.com/2019/03/aspect-ratio-unit-c...
Recent Chrome and Firefox use that to determine aspect ratio for jank-free loading.