为什么我的Android设备宽度为980像素? [英] Why is my Android device-width 980px?

查看:288
本文介绍了为什么我的Android设备宽度为980像素?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我很困惑。根据大多数来源,例如

I am confused. I am trying to make a website responsive by playing around with media queries.

com / snippets / css / media-queries-for-standard-devices /rel =nofollow>这,用于智能手机的mediq查询是 max-device-width: 480px min-device-width:320px

according to most sources, for example this, the mediq-query to use for smartphones is max-device-width: 480px and min-device-width: 320px.

查询,我的Android 2.x仍然显示页面的计算机版本。所以我开始更改查询的值,并注意到我的手机似乎有980px的设备宽度。

But when i use these queries, my android 2.x does still show the "computer version" of the page. So i started changing the values on the query and noticed that my phone seems to have the device-width of 980px..

为什么?我真的想要抓住这一点,确定我可以很高兴与它工作时使用980但我想知道发生了什么,为什么?我的意思是我的手机不应该是980px宽或高的问题,是某种像素密度问题吗?

Why is that? I really want to get a grip of this, sure i could just be happy with it working when using 980 but I want to know what is going on and why? I mean my phone isn't supposed to be 980px wide or high for that matter, is it some kind of pixel density problem?

推荐答案

p>您可能想尝试使用 max-width 而不是 max-device-width 。这可能是一个像素密度的东西 - max-device-width 可能是报告设备像素而不是CSS像素。

You might want to try using max-width instead of max-device-width. It could well be a pixel-density thing - max-device-width might be reporting device pixels instead of CSS pixels.

以下是测试页:

  • http://jsfiddle.net/56XhE/

为了真正得到一个句柄,想要阅读Peter-Paul Koch的两个视窗的故事:

To really get a handle on this, you'll want to read Peter-Paul Koch's "A Tale of Two Viewports":

  • http://www.quirksmode.org/mobile/viewports.html
  • http://www.quirksmode.org/mobile/viewports2.html

也许他对移动设备进行CSS的建议:

And possibly his recommendation on doing CSS for mobile devices:

  • http://www.quirksmode.org/blog/archives/2010/09/combining_meta.html

这篇关于为什么我的Android设备宽度为980像素?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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