``` ```css .box { width: 500px; position: relative; } .box-inner { position: absolute; top: 0; left: 0; width: 100%; height: 100%; } ``` # Using modern CSS Using modern CSS, maintaining an element's aspect ratio becomes so much easier with the `aspect-ratio` CSS property. ```css .box { aspect-ratio: 16 / 9; } ``` ## Resources: 1. [Percentage Padding Trick](https://css-tricks.com/oh-hey-padding-percentage-is-based-on-the-parent-elements-width/) 1. [CSS aspect-ratio](https://developer.mozilla.org/en-US/docs/Web/CSS/aspect-ratio)" data-react-helmet="true" />
``` ```css .box { width: 500px; position: relative; } .box-inner { position: absolute; top: 0; left: 0; width: 100%; height: 100%; } ``` # Using modern CSS Using modern CSS, maintaining an element's aspect ratio becomes so much easier with the `aspect-ratio` CSS property. ```css .box { aspect-ratio: 16 / 9; } ``` ## Resources: 1. [Percentage Padding Trick](https://css-tricks.com/oh-hey-padding-percentage-is-based-on-the-parent-elements-width/) 1. [CSS aspect-ratio](https://developer.mozilla.org/en-US/docs/Web/CSS/aspect-ratio)" data-react-helmet="true" />
``` ```css .box { width: 500px; position: relative; } .box-inner { position: absolute; top: 0; left: 0; width: 100%; height: 100%; } ``` # Using modern CSS Using modern CSS, maintaining an element's aspect ratio becomes so much easier with the `aspect-ratio` CSS property. ```css .box { aspect-ratio: 16 / 9; } ``` ## Resources: 1. [Percentage Padding Trick](https://css-tricks.com/oh-hey-padding-percentage-is-based-on-the-parent-elements-width/) 1. [CSS aspect-ratio](https://developer.mozilla.org/en-US/docs/Web/CSS/aspect-ratio)" data-react-helmet="true" />omniquotient