【发布时间】:2015-07-05 10:30:34
【问题描述】:
我也有类似的问题:Software keyboard resizes background image on Android
那里提供的解决方案适用于 Android 开发。他们没有帮助。我正在为一般使用 CSS/JavaScript 的网站寻找解决方案。
我当前的 CSS:
#video_mob {
position: fixed;
background: url(../terminal/background.gif) no-repeat center center fixed;
background-size: cover;
-webkit-background-size: cover;
top: 0px;
left: 0px;
min-width: 100%;
min-height: 100%;
width: auto;
height: auto;
z-index: -1000;
overflow: hidden;
}
一种选项可以修复它,但背景实际上会向上移动。
-webkit-background-size: 280% auto;
还有什么想法吗?欢迎使用 CSS 或 JS 解决方案。
【问题讨论】:
-
是的...这个问题可能对你有帮助。stackoverflow.com/questions/11099930/…
-
这里有个主意,试试
background-attachment: fixedw3schools.com/cssref/pr_background-attachment.asp -
background-attachment: fixed不起作用,但感谢 sweeds 的调查 :) 我在下面找到了解决方案。