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
Explorer Edge Chrome Firefox Opera Safari
91233.59.54.1
Tablets / Mobile
Android Chrome Firefox Opera Safari Samsung
≤37184Yes4.21.0

Last updated by CSSPortal on: 9th December 2019