Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Difference between aspect-ratio and device-aspect-ratio in CSS media queries

What is the difference in simple terms between aspect-ratio and device-aspect-ratio?

like image 634
poptag Avatar asked Apr 20 '11 05:04

poptag


People also ask

What is device-aspect-ratio?

The aspect ratio of a display device is the proportional relationship between the width and the height of the display. It is expressed as two numbers separated by a colon (x:y), where x corresponds to the width and y to the height. Common aspect ratios for displays, past and present, include 5:4, 4:3, 16:10 and 16:9.

What is aspect ratio in media query?

The aspect-ratio feature is specified as a <ratio> value representing the width-to-height aspect ratio of the viewport. It is a range feature, meaning you can also use the prefixed min-aspect-ratio and max-aspect-ratio variants to query minimum and maximum values, respectively.

What is CSS aspect ratio?

The CSS property aspect-ratio lets you create boxes that maintain proportional dimensions where the height and width of a box are calculated automatically as a ratio.


1 Answers

For everyone who is confused about the difference between targeted display area and output device regarding the aspect-ratio:

targeted display area

Aspect ratio of your browser window or the area your website is displayed on (a special case would for example be an embedded website)

output device

Physical aspect ratio of the screen. E.g. of your smartphone or desktop display

As smartphones and tablets usually display apps in fullscreen mode only, aspect-ratio and device-aspect-ratio are the same. On a desktop computer this surely is not always the case as the user can resize the browser window and thus the aspect-ratio changes.

I hope it helps.

like image 200
F Lekschas Avatar answered Sep 20 '22 16:09

F Lekschas