我用于我的背景(已修复)的图像以Web格式显示为100%,但是当我在Ipad(1024x768)上模拟它时,图像停止适应屏幕宽度仅占屏幕高度的70%。Ipad上的背景图像不显示100%
这是我用过的网站格式的CSS:
.body{
background-image: url("/img/bg.jpg");
background-repeat: no-repeat;
background-attachment: fixed;
background-size: 100% auto;
height: 5700px;
width: 100%;
}
这是我用过的iPad风格的CSS:
@media screen and (max-width: 1024px) {
.body{
background-image: url("/img/bg.jpg");
background-repeat: no-repeat;
background-attachment: fixed;
background-size: 100% auto;
height: 5700px;
min-width: 1024px;
}
}
我试着min-width: 1024px;
因为我发现了一个类似的question与该建议,但它没有奏效。
可以试试宽度:100vw;?如果有帮助,我会写一个答案 – RacoonOnMoon
@Traver ok,我现在就试试。 – Calicorio
我试过它在背景大小(不是宽度),它已经工作!谢谢!我会在下面发布完整的答案。 – Calicorio