<分区>
<分区>
我最近更换了显示器,现在我使用的是 1920x1080 分辨率,我注意到 background-size
属性在我的一个网站上出现故障(要么或者我一直误解了它是如何工作的)。
问题是,无论我将其设置为 cover
还是 100% 100%
。它永远不会覆盖整个页面高度(html 和 body 标签都有 min-height: 100vh。I applied a blue background to the body just to check it had the proper size )。
可以查到问题网站here .
body {
background: url("../resources/images/bg.jpg") fixed;
background-size: cover;
margin: 0;
color: $c-golden-darker;
text-shadow: #1a0e0b 0 0 3px, #1a0e0b 0 0 3px;
font-family: Verdana, Arial;
overflow-y: scroll;
min-height: 100vh;
height: auto;
}
编辑:再看一遍,图像本身是 JPEG,因此它具有透明像素没有任何意义。
EDIT2:将图像重新上传到服务器以某种方式解决了问题。
最佳答案
关于html - 背景大小无法正常工作,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/37509463/