【问题标题】:How to figure out the right size background image for iPhone如何为 iPhone 找出合适大小的背景图片
【发布时间】:2013-09-04 09:18:29
【问题描述】:

我正在使用媒体查询来创建屏幕中断,以便在桌面和移动设备上优化网站。目前,当我使用当前的 css 启动该网站时,背景图片被拉伸得不成比例。 (当前背景尺寸为:640px x 960px。)

这是当前的 css:

@media only screen and (-webkit-min-device-pixel-ratio : 2), only screen and (min-device-    pixel-ratio : 2) {

    #home{width: 980px;
        height: 1090px;
        background-image: url(../images/landingPageRetina.jpg) 50% 0 no-repeat;
        background-size: 100% 100%;}

    #about{background-image: url(../images/aboutMobile.png) 50% 0 no-repeat;}


    #music{background-image: url(../images/musicMobile.jpg)  50% 0 no-repeat;}

    #videos{background-size: url(..images/videosMobile.jpg)50% 0 no-repeat;}

    #connect{background-image: url(..images/connectMobile.jpg)50% 0 no-repeat ;}

    #contact{background-image: url(../images/contactMobile.jpg)50% 0 no-repeat ;}
}

是否有人对正确的尺寸有任何建议 - 以便图像按比例呈现?

【问题讨论】:

    标签: iphone ios css mobile media-queries


    【解决方案1】:

    iPhone5 是 640x1136。更多详情请看粉碎杂志这篇文章:http://mobile.smashingmagazine.com/2013/03/21/responsive-web-design-with-physical-units/

    最好使用的背景是不需要太多媒体查询即可使其看起来不错的背景。试试 CSS3 渐变或平铺背景...

    【讨论】:

    • 640x1136* 此外,在旧款 iPhone 中,分辨率为 640x960。
    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 2017-10-28
    • 2015-11-13
    • 2015-06-04
    • 1970-01-01
    • 2015-07-30
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多