Is scaling in the browser the same as scaling on a mobile device?

When I Ctrl+ in a modern browser, scaling the page, including images; a similar effect occurs when compressing and scaling on a mobile device. Everything on the page scales proportionally.

My question is when the browser scales, and when the mobile device scales, do they do the same inside? I'm particularly interested in the relationship of physical pixels with display pixels with device-independent pixels. This is a domain that can quickly collapse when considering media queries, etc.

Edit: I have good answers, I appreciated this. I was hoping to find how they differ from a technical point of view. that is, "one scales x, the other scales y". Can you read here?

+6
source share
3 answers

In my observations not, they are not the same. When I zoom in on my mobile device, it scales without affecting the relative page size. When I Ctrl- + on a PC, the page is adjusted to fit the width of the pixels on the screen, which changes the streams to match the content with fewer "virtual" pixels.

EDIT: There is also a difference between mobile pinch zoom and mobile double tap. I noticed that double-click scaling affects the flow of a page, while pinching does not.

As for CSS pixels, isn't it obvious how elements with dimensions defined in units of px influence? It would seem that โ€œCSS pixelsโ€ remain in the way they were designed to be 100% /

+3
source

No, in general, browsers customize the CSS of an existing document for resizing. Mobile devices scale the "image" of a document.

0
source

The simple answer is no, they are not the same.

When using zoom zoom with a phone, everything scales.

when using ctrl + in a browser, CSS rules apply.

For example, if you had a left panel that was specified as 200em, then the right panel was specified to automatically fill, and then when ctrl + was removed, the right panel will take up more space and the space used by the right panel will be reduced, but text size will be larger.

Some browser processing units are different. Some scales some not. For example, for some browsers, if px is used to indicate the size, it will not change even when you press ctrl + (mostly older browsers). Generally, if you want things to scale when ctrl + hits and scales properly, it is often recommended to use an em module, because it is based on the font size that scales when you press ctrl +.

Unfortunately, each browser handles scaling a little differently, and the only way to make sure that your page will scale as expected is to check in the browser of interest.

0
source

Source: https://habr.com/ru/post/908450/


All Articles