em vs px… for mobile browsers

前端 未结 5 2128
醉酒成梦
醉酒成梦 2021-02-01 20:26

For desktop browser all modern browser uses Zoom functionality so we can use PX but if same site can be seen on mobile then would px not be good for zooming in mobile browsers.

5条回答
  •  無奈伤痛
    2021-02-01 20:50

    px won't be a real actual pixel when the screen is zoomed out on a modern mobile browser. These browsers are effectively emulating a desktop browser with desktop browser-size pixels.

    So for this type of browser using px is no worse than it is for a normal desktop browser. You can do it if you want without major problems, but in both situations em is preferable for the main body content, if you can.

提交回复
热议问题