我正在使用媒体查询来创建屏幕中断,以便在桌面和移动设备上优化网站。目前,当我使用当前的 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 ;}
}
有没有人对正确的尺寸有任何建议 - 以便图像按比例呈现?