"背景大小:盖"不包括手机屏幕 [英] "background-size: cover" does not cover mobile screen

查看:108
本文介绍了"背景大小:盖"不包括手机屏幕的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有照片的背景上使用背景大小的我的网站:覆盖。它的工作原理在大多数情况下,但在纵向模式下对我的银河S3一个奇怪〜30像素的空白。

I have a photo background on my site using background-size:cover. It works for the most part but leaves a weird ~30px white space on my Galaxy S3 in portrait mode.

我已经附上截图。的1像素青色线是为了说明整个屏幕。好像背景社交媒体后立即停止 UL 秒。

I've attached a screenshot. The 1px teal line is to illustrate the entire screen. Seems like the background stops right after the social media uls.

我通过删除 UL 此测试和背景附着其自我标语文本的底部。

I tested this by removing the ul and the background attached it self to the bottom of the tagline text.

此外,这里是属于移动波泰特查看我的CSS:

Also, here's my CSS pertaining mobile portait view:

@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;
}

这用来不会发生,但我想我不小心窃听它,而试图解决的另一个问题。

This used to not happen, but I guess I accidentally bugged it while trying to solve another issue.

推荐答案

在尝试不同的东西,加入小时最小高度:100%; 来的底部 HTML {背景:...}在为我工作。

After hours of trying different things, adding min-height: 100%; to the bottom of html under the { background:... } worked for me.

这篇关于"背景大小:盖"不包括手机屏幕的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
相关文章
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆