【发布时间】:2019-04-30 23:24:39
【问题描述】:
我通过在这样的元素上创建固定位置的背景来创建视差图像:
#element:before {
content: '';
background: url('sample.jpg') no-repeat;
position: fixed;
width: 100%;
height: 100%;
z-index: -1;
left: 0;
top: 0;
background-position: 68% center;
transform: translate3d(0,0,0);
}
效果很好,只是我注意到,当在手机上看到地址栏时,它实际上会偏离我固定元素的定位。有谁知道如何避免这种情况?
谢谢
【问题讨论】: