<ratio>
Baseline Widely available *
This feature is well established and works across many devices and browser versions. It’s been available across browsers since July 2015.
* Some parts of this feature may have varying levels of support.
Тип данных CSS <ratio>
используется для описания соотношений сторон в медиавыражениях, обозначает соотношения между двумя безразмерными значениями.
Синтаксис
Примеры
Использование в медиавыражениях
css
@media screen and (min-aspect-ratio: 16/9) { ... }
Общее соотношение сторон
Ratio | Usage | |
---|---|---|
![]() |
4/3 |
Традиционный TV-формат 20th века. |
![]() |
16/9 |
Современный "широкоэкранный" TV-формат. |
![]() |
185/100 = 91/50 (нецелые делимые и делители не допускаются) |
Наиболее распространённый видео-формат в 1960-х. |
![]() |
239/100 (нецелые делимые и делители не допускаются) |
"Широкоэкранный," анаморфный видео-формат. |
Спецификации
Specification |
---|
CSS Values and Units Module Level 4 # ratio-value |
Совместимость с браузерами
Report problems with this compatibility data on GitHubdesktop | mobile | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|
<ratio> | ||||||||||||
Accepts a single <number> as a value. |
Legend
Tip: you can click/tap on a cell for more information.
- Full support
- Full support
- No support
- No support
- Experimental. Expect behavior to change in the future.
The compatibility table on this page is generated from structured data. If you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request.
Смотрите также
aspect-ratio
медиа-функция