【发布时间】:2013-03-14 17:21:21
【问题描述】:
我正在安卓标签和手机上测试 html 文件。不同分辨率的视口 我使用元视口:
<meta name="viewport" content = "width=device-width , target-densityDpi=device-dpi , user-scalable = no , initial-scale=.51,maximum-scale=0.51,minimum-scale=0.51"/>
但它不工作意味着不缩放我的 BG 图像。
我也试过了:
<meta name="viewport" content = "width=device-width;target-densityDpi=device-dpi ; user-scalable = no ;initial-scale=.51;maximum-scale=0.51;minimum-scale=0.51"/>
唯一的区别是';'但在它上面 logcat 显示视口被忽略
我不明白为什么会这样
这是我的 css 文件:
body {
background-repeat: no-repeat;
margin: 0;
}
div { width: 1280px; height: 670px; }
home {
background-image: url('../images/abc_title.png');
width: 1280px;
height: 670px;
background-repeat: no-repeat;
}
abc_slide {
position: relative; background : transparent;
width: 129px;
height: 76px;
background: transparent; width : 129px; height : 76px;
margin-top: 80px;
margin-left: 80px;
border: thin;
}
song_slide {
position: relative;
background: transparent;
margin-top: 80px;
margin-left: 80px; width : 129px;
height: 76px;
width: 129px;
border: thin;
}
HTML:
通过这些设置,我在标签 2 7 上看到以下情况:
添加后不重复的卷轴已经存在了。
【问题讨论】:
-
哪个版本的安卓?
-
你想达到什么目的?背景的 CSS 样式是什么?
-
2.2 并在 4.0.1 上运行
-
@Stan 我想使用 Viewport 为 android 设备和 iphone 设备提供多种分辨率
-
@User95280,这很明显,但您主要关心的是背景。如果要缩放背景,请使用
background-size: cover;。