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

后端 未结 2 825
情话喂你
情话喂你 2021-01-01 12:26

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 (

相关标签:
2条回答
  • 2021-01-01 13:17

    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).

    0 讨论(0)
  • 2021-01-01 13:21

    Zooming as implemented in modern browsers consists of nothing more than “stretching up” pixels. That is, the width of the element is not changed from 128 to 256 pixels; instead the actual pixels are doubled in size. Formally, the element still has a width of 128 CSS pixels, even though it happens to take the space of 256 device pixels.

    In other words, zooming to 200% makes one CSS pixel grow to four times the size of one device pixels. (Two times the width, two times the height, yields four times in total).

    For detailed explanation you could read the following page: Concept of device pixels and CSS pixels

    0 讨论(0)
提交回复
热议问题