我有一个“水平”图像作为背景(它是 2048x1148)。
我设置了 background:url("") no-repeat scroll center top/cover
并且在桌面模式下一切正常。在移动设备中,我无法让背景图像缩放并自动覆盖高度。 background-size:cover
不应该自动完成吗?
Here是实时站点。
最佳答案
让你的页面覆盖孔视口(viewport):
html, body{
height: 100%;
}
或使用最小高度
。
关于html - 背景大小:封面仅适合宽度,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/25583533/