【问题标题】:Background trouble in Iphone4 designIphone4设计中的背景问题
【发布时间】:2012-06-12 22:52:12
【问题描述】:

我的 iPhone 网页布局有问题,我的背景图片不适合 safari 的视图(在 iPhone4 中),我的背景图片大小:w:480 px / h:720px

我的身体 css 代码:

body
{
height:100%;
margin:0px;
background-image:url(../images/bg.png);
background-repeat:no-repeat;
background-size: cover;
}

其实,我真的不知道视网膜显示器和普通3g显示器的背景分辨率应该是多少...以及如何调整它们...

如果有人可以帮助我,我会很高兴...

【问题讨论】:

  • 对于初学者来说,标准(3G 和 GS)屏幕是 480x320。视网膜是双倍的,所以 960x640
  • 如果我将背景图像尺寸设为 960X640,在 3g 图像中将无法正常工作?如果没有单独的 css 文件并设置用户拥有的 iPhone 型号的条件,我该如何做到这一点?

标签: iphone jquery-mobile mobile mobile-safari


【解决方案1】:

您好,请使用此代码代替您的正文:

body{
font-size:100%;
background:url(../images/bg.png) no-repeat center top;
background-size:100% auto;
margin:0 auto;
}

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 2014-12-11
    • 2014-01-10
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多