Answer the question
In order to leave comments, you need to log in
[Responsive layout] What pixels does background-size (logical / device) use?
By boolean, I mean that when you go to screens, they will be scaled by the pixel-ratio value.
Those. Let's say I have a device with pixel-ratio = 2 and an element with width = 100px, height = 100px with an image on a 100x100 background. If I'm not mistaken, the image should take up a quarter of the element (1/2 width, 1/2 height).
But what size will the displayed image be on this device with background-size = 100px? I see 2 options:
1. Nothing will change. Those. background-size defines the size in pixels of the image (aka device pixels).
2. The picture will fill the entire square of the element. Those. background-size specifies the size in logical pixels (the ones that set the width and height).
Answer the question
In order to leave comments, you need to log in
If I'm not mistaken, the image should take up a quarter of the element (1/2 width, 1/2 height).
I think option 3 is correct - make a primitive page on jsfiddle and open from mobile
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question