aspect-ratio media feature
Defined as the ratio of value of the width media feature to the value of the height media feature.
Possible values
- Value: <ratio>
- Applies to: bitmap media types
- Accepts min/max prefixes: yes
Remarks
The Cascading Style Sheets (CSS) <ratio> type is defined in the Media Queries specification as a positive (not zero or negative) integer followed by optional whitespace, followed by a solidus ("/"), followed by optional whitespace, followed by a positive integer—for instance, "16/9".
Example
The following declaration will apply "border:none" when the screen's aspect ratio is 91/50 (equivalent to 1.85, which is a common widescreen movie aspect ratio) or smaller.
@media screen and (max-aspect-ratio: 91/50) {
div {
border: none;
}
}
Show: