.wideBox {
aspect-ratio: 5 / 2;
}
.tallBox {
aspect-ratio: 0.25;
}Aspect ratio / notebook
Aspect ratio
Runnable notebook: every JavaScript, HTML and CSS example on this page executes in a sandboxed local frame. Nothing leaves the browser.
<svg viewBox="0 0 300 100" xmlns="http://www.w3.org/2000/svg"></svg>const constraints = {
width: 1920,
height: 1080,
aspectRatio: 1.777777778,
};
myTrack.applyConstraints(constraints);