【发布时间】:2016-10-09 18:47:14
【问题描述】:
背景图片在 PC 和模拟器(平板电脑和手机)上完美显示,但不会在实际手机/平板电脑上显示。
代码
div#photo_break {
@include viewport-unit(height, 28vw);
background-image: url('<img>');
background-repeat: no-repeat;
background-size: 100% auto;
-webkit-background-size: 100% auto;
-moz-background-size: 100% auto;
-o-background-size: 100% auto;
background-position: center top;
background-attachment: fixed;
z-index: 99999;
}
正如您在这张图片中看到的那样,在Chromes simulator中显示了图片。
图片的尺寸不是很大,是吗?
【问题讨论】:
-
什么样的手机/平板电脑?如果是 iOS,则可能是您的背景图片尺寸有问题。
-
@Pekka웃 我在 iPad Air 2、iPhone 6s 和三星 S2 上测试过
标签: css mobile sass background-image tablet