【发布时间】:2015-12-14 15:44:38
【问题描述】:
我有一个在向下滚动页面时保持原位的背景图像。
在此处查看 JSFiddle:JS Fiddle
代码
body {
font-family: 'Open Sans', sans-serif;
background-image: url("http://vrexpert.virtualrealities.netdna-cdn.com/wp-content/uploads/2015/12/Google5.jpg");
background-repeat: no-repeat;
background-size: cover;
width: 100%;
height: 100%;
background-attachment: fixed;
overflow-x: hidden !important;
}
但是
使用移动设备时不会应用此功能。(例如,我使用的是 iPad)。图片不随页面滚动。
如何在移动设备上获得与在桌面上相同的结果?
【问题讨论】:
标签: css html twitter-bootstrap background