em vs px ...用于移动浏览器 [英] em vs px... for mobile browsers

查看:124
本文介绍了em vs px ...用于移动浏览器的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

对于桌面浏览器,所有现代浏览器都使用缩放功能,因此我们可以使用PX,但如果在移动设备上可以看到相同的网站,则px不适合放大移动浏览器。或使用px也适用于移动浏览器。

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. or use of px is also fine for mobile browsers.

即使我们不关心IE 6,如果我们不使用px,我们应该使用em不同的网站为移动,同一网站将会在桌面和手机(iphone,黑莓,Windows移动,歌剧迷你,Android等)上看到

even if we don't care for IE 6 , should we use em in place of px still if we are not making different site for mobile, same site will be seen on both desktop and mobile phones (iphone, blackberry, windows mobile, opera mini, android etc?

推荐答案

px 将不会是一个真实的实际像素,当屏幕在现代移动浏览器上缩小时这些浏览器有效地模拟桌面浏览器与桌面浏览器大小的像素。

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.

所以对于这种类型的浏览器使用 px 没有比正常你可以这样做,如果你想没有重大问题,但在这两种情况下, em 是主体内容,如果可以。

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.

这篇关于em vs px ...用于移动浏览器的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆