CSS <ratio> Data Type
Description
The <ratio>
CSS data type is used for describing aspect ratios in media queries, denotes the proportion between two unitless values.
Syntax
property: <ratio>;
Values
- <ratio>Is a positive (not zero or negative) <integer> followed by optional whitespace, followed by a solidus ('/'), followed by optional whitespace, followed by a positive <integer>.
Example
@media screen and (min-aspect-ratio: 16/9) { ... }
Browser Support
Desktop | |||||
9 | 12 | 3 | 3.5 | 9.5 | 5 |
Tablets / Mobile | |||||
![]() |
|||||
≤37 | 18 | 4 | 14 | 4.2 | 1.0 |
Last updated by CSSPortal on: 9th December 2019