2012-06-12 51 views
0

我有一个布局iPhone网页的问题,我的背景图片不适合Safari浏览器(在iPhone4中),我的背景图片尺寸:w:480 px/h:720pxIphone4设计背景问题

我的身体CSS代码:

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

其实,我真的不知道应该怎样为视网膜显示屏和正常的第三代显示分辨率背景...以及如何调整他们...

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

+1

对于初学者来说,一个标准(3G和GS)屏幕是480x320。视网膜是双倍所以960x640 – Dancreek

+0

如果我使背景图像尺寸960X640,在3G图像将无法正常工作?我怎样才能做到这一点,而不需要单独的CSS文件,并且如果用户拥有iPhone模型的条件呢? –

+0

http://lineandpixel.com/blog/ios-web-app-icons-and-startup-images和 https://gist.github.com/2222823可能有帮助 –

回答

1

你好,请使用此代码,而不是你的身体:

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