4 ms·
That's coming! It's not implemented in any browsers yet, but it should be soon. It was introduced in "CSS Intrinsic & Extrinsic Sizing Module Level 4". It will
by frosted-flakes 7y ago
That's coming! It's not implemented in any browsers yet, but it should be soon. It was introduced in "CSS Intrinsic & Extrinsic Sizing Module Level 4".
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-ratio 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-css/ https://www.smashingmagazine.com/2019/03/aspect-ratio-unit-c...
- earthboundkid 7y agoThat’s Grrrreat!
- Tomte 7y agoYou can set the width and height attribute (HTML attribute, not CSS property) today. Recent Chrome and Firefox use that to determine aspect ratio for jank-free loading.
- frosted-flakes 7y agoFor images and iframes, but I don't think that works for any element. In any case, hardcoding that kind of information in the HTML is not ideal.