背景大小:覆盖导致背景图像在移动Chrome触摸调整大小
Background-size: cover causing background image to resize on touch in mobile Chrome
我遇到了一个问题,我正在将移动设备中页面的背景图像设置为专为移动设备设计的新图像。该图像设置为background-size: cover
,并且在除移动Chrome之外的所有内容中工作良好。在移动Chrome中滚动时,图像会稍微调整大小。该设计还具有绝对页脚。你可以在这里看到它的作用:
body {
height: 100%;
overflow: scroll;
}
.image {
display: block;
background: url(http://drawingimage.com/files/1/Shrek-Donkey-Beautiful-Image-Drawing.png) no-repeat center bottom;
background-size: cover;
-webkit-background-size: cover;
-moz-background-size: cover;
position: absolute;
top: 0;
left: 0;
right: 0;
bottom: 0;
}
.footer {
display: block;
position: absolute;
width: 100%;
bottom: -69px;
background-color: green;
}
<body>
<div class="wrap">
<div class="image">
</div>
<div class="footer">
<p> Footer info </p>
<p> More footer info</p>
</div>
</div>
</body>
如果它覆盖了背景,那么它为滚动留出了空间。也许会约束容器。或者考虑使用任何类型的媒体查询来捕捉移动设备大小的问题。将其切换为仅在移动设备上包含。或者移除移动设备上的溢出滚动
相关文章:
- 背景图像顶部的滚动图像不移动
- 苹果/野生动物园在移动设备上播放背景视频时出现问题
- 如何使用onmousemove函数在每次鼠标移动时更改背景图像
- 动态更改jQuery移动图标的背景颜色
- 可以使用jQuery'移动HTML背景吗;s设置动画
- 移动背景断断续续/滞后
- CSS使用鼠标使许多背景以不同的速度移动
- 如何在移动设备中查看模式框时停止背景滚动,只需使用CSS或Javascript
- 移动Web点击背景颜色
- 鼠标移动时模糊和透明的圆形背景效果
- 整页.js - 在背景视频循环播放时向右移动幻灯片
- 如何在移动浏览器中制作固定背景以覆盖整个屏幕
- 如何重新绘制背景,使其看起来像我的“播放器”在html5-canvas中移动
- 缩小时如何阻止背景移动
- 为移动浏览器设置全尺寸背景图像的替代方法
- 通过箭头键移动背景
- Javascript/CSS :无法使用 positionBackground 移动背景
- 将鼠标悬停在同一列表中的其他链接时移动水平背景线
- 将弹出窗口从背景移动到前景
- 如何使背景移动慢于文本在滚动