我在我的网站上使用background-size:cover
的背景照片。它在大多数情况下工作,但在人像模式下在我的Galaxy S3上留下了一个奇怪的〜30px空白区域。“背景大小:封面”不包括手机屏幕
我附上了截图。 1px深青线是为了说明整个屏幕。似乎背景在社交媒体ul
之后立即停止。
我通过删除ul
和背景将其自身附加到标语文本的底部来测试了这一点。
而且,这里是属于移动波泰特查看我的CSS:
@media only screen and (max-width: 480px) {
.logo {
position: relative;
background-size:70%;
-webkit-background-size: 70%;
-moz-background-size: 70%;
-o-background-size: 70%;
margin-top: 30px;
}
h1 {
margin-top: -25px;
font-size: 21px;
line-height: 21px;
margin-bottom: 15px;
}
h2 {
font-size: 35px;
line-height: 35px;
}
.footer_mobile {
display: block;
margin-top: 20px;
margin-bottom: 0px;
}
li {
display: block;
font-size: 1.3em;
}
过去,这不会发生,但我想我不小心窃听它试图解决的另一个问题。
HTML,用于背景图片的CSS? – tobiv
该CSS为'html { \t \t background:url(../ images/bg。JPG)不重复右上方固定; \t \t -webkit-background-size:cover; \t \t -moz-background-size:cover; \t \t -o-background-size:cover; \t \t background-size:cover; \t} ' –
只有几个猜测:你尝试过'HTML {height:100%}',还是试图将背景附加到'body'而不是'html'? – tobiv