我想创建一个移动网站为Android。当我把身体的宽度480px(屏幕的宽度)的结果比我所期望的大50%左右。看来,Android是缩放它平搞乱了我所有的布局。有谁知道如何禁用它,或者解决它?
我已经使用这样的:
< META NAME =视口内容=WIDTH =设备宽度,高度=设备高度,用户可扩展性=无,初始规模= 1.0,最大规模= 1.0,最小规模= 1.0/>
解决方案
您错过的秘密全新的Android,只视性target-densityDpi"你可以用它来配置浏览器的缩放。详情参见链接的问题。
I'm trying to create a mobile website for android. When I set the width of the body to 480px (the width of the screen) the result is about 50% larger than what I expect. It seems that android is scaling what it draws and messing up all my layouts. Does anyone know how to disable this, or work around it?
I'm already using this:
<meta name="viewport" content="width=device-width, height=device-height, user-scalable=no, initial-scale=1.0, maximum-scale=1.0, minimum-scale=1.0" />
解决方案
You're missing the secret new Android-only viewport property "target-densityDpi" which you can use to configure browser scaling. See the linked question for more details.