@media screen and (aspect-ratio >= 16/9) {
/* … */
}`<ratio>` CSS type / notebook
`<ratio>` CSS type
Runnable notebook: every JavaScript, HTML and CSS example on this page executes in a sandboxed local frame. Nothing leaves the browser.
@container (aspect-ratio > 1) and (width < 20em) {
/* … */
}.square {
aspect-ratio: 1 / 1;
}
.circle {
aspect-ratio: 1;
border-radius: 50%;
}
.portrait {
aspect-ratio: 5 / 7;
}