我有一个类似的问题: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 解决方案。
最佳答案
啊,找到解决方案了!我真傻。
仅供引用,这是要求:
background: url(../terminal/background.gif) no-repeat center top fixed;
background-size: 280% auto;
必须将位置设置为中心顶部。
关于Android软键盘调整背景图片大小(网站),我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/29887809/