简体   繁体   English

如何找出适合iPhone的尺寸背景图片

[英]How to figure out the right size background image for iPhone

I am working with media queries to create screen breaks, in order to have a website optimized on both the desktop and mobile. 我正在与媒体查询合作创建屏幕快照,以便在台式机和移动设备上优化网站。 Currently, when I bring the site up with its current css the background pictures are stretched out of proportion. 当前,当我使用当前的CSS来启动网站时,背景图片会超出比例。 (The current background sizes are: 640px x 960px.) (当前背景尺寸为:640px x 960px。)

Here is the current css: 这是当前的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 ;}
}

Does anyone have any suggestions on what the correct sizes are - so that the images will render proportionally? 是否有人对正确的尺寸有任何建议-以便图像按比例渲染?

iPhone5 is 640x1136. iPhone5是640x1136。 Look at this article by smashing magazine for more details: http://mobile.smashingmagazine.com/2013/03/21/responsive-web-design-with-physical-units/ 通过smashing杂志查看这篇文章,了解更多详细信息: http : //mobile.smashingmagazine.com/2013/03/21/sensitive-web-design-with-physical-units/

The best background to use is one that won't require so many media queries in order to make it look good. 最好使用的背景是不需要太多媒体查询就能使其看起来不错的背景。 Try CSS3 gradients or tiled backgrounds... 尝试CSS3渐变或平铺背景...

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM