1/* Minimum aspect ratio */
2@media (min-aspect-ratio: 8/5) {
3 div {
4 background: #9af; /* blue */
5 }
6}
7
8/* Maximum aspect ratio */
9@media (max-aspect-ratio: 3/2) {
10 div {
11 background: #9ff; /* cyan */
12 }
13}
14
15/* Exact aspect ratio, put it at the bottom to avoid override*/
16@media (aspect-ratio: 1/1) {
17 div {
18 background: #f9a; /* red */
19 }
20}
21