html - 放大后背景图像缩小,然后屏幕旋转并缩小

标签 html css screen-orientation

我注意到我正在构建的网站上存在错误。当你在手机上放大,然后旋转屏幕方向,然后缩小背景缩小,只有再次旋转屏幕时才恢复到原来的大小。知道我哪里出错了吗?

这是我使用的 CSS:

html { 
background: url(images/scroll.jpg) no-repeat center center fixed; 
-webkit-background-size: cover;
-moz-background-size: cover;
-o-background-size: cover;
background-size: cover;
min-height: 100%;
}

干杯

最佳答案

在使用 cover 之前简单地删除 fixed 解决了这个问题。

background: url(images/scroll.jpg) no-repeat center center; 

关于html - 放大后背景图像缩小,然后屏幕旋转并缩小,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/27368246/

相关文章:

html - 太多的类与灵活可读的 css 类

ios - 如何检测 iOS View Controller 的当前方向?

javascript - 搜索特定文本的类并返回条目号

html - 为什么我的 <h1> 消失了?

python - LXML - 解析 tr 标签内的 td 内容

html - 使用 html 和 css 的字体大小问题

css - 如何将我的页脚中的链接设置为白色?

javascript - 数据插件选项过滤器不起作用

iOS 7+ 关闭模态视图 Controller 并强制纵向

android - View 的 getHeight() 在 Android 中为纵向和横向提供相同的结果