'What exactly changes in the css rendering, when desktop browsers zoom in or out on a website?

In what way is the design scaled up or down? I'm trying to figure out what exactly happens at the CSS level, and what the consequences are for different sizing methods (px, em, rem, etc).


By the way, I am mainly concerned with zooming behaviour for modern desktop browsers. (I suspect mobile browser to be a straight enlargement of the whole page after rendering it normally, and know that old fashioned browsers just increment the base font-size). What isn't clear however, is what modern browsers (say the latest versions of Chrome or FF) do exactly when the user presses Ctrl + or Ctrl -.

Do they also just render the page normally (i.e. at 100%) and then just enlarge the rendered image? Because FF still seems to respect % widths for example, so it doesn't seem to be a straight up enlargement.



Solution 1:[1]

If you are referring to what happens within the browser when you zoom, it depends on what browser you are using, and on what device. I believe the type of measurement unit you use in your CSS can also be a factor (%, em, and px). But typically, say the CSS applied to fonts, that gets rendered again when you zoom. Same with background property values. But in many browsers this re-rendering happens so fast you shouldn't even notice it, unless there is some performance issue that is slowing the browser down (which could be code or system related).

Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source
Solution 1 Opaw Nako