<div>I'm 16:9</div>
<style>
div {
background: lime;
--aspect-ratio: 478/239;
}</style>
html {
background: #999;
}
body {
width: 300px;
background: white;
padding: 20px;
}
div {
display: grid;
place-items: center;
}
This Pen doesn't use any external CSS resources.