纯视差效果在左侧不起作用 space
Pure parallax effect not working space on the left side
我对纯 css 视差效果有一个奇怪的问题。我遵循了本教程:https://css-tricks.com/tour-performant-responsive-css-site/
但是就像在示例中一样,我在左侧站点上有一个白色 space。经过一些研究,我读到这应该是基于 webkit 的浏览器中独有的错误,但我在 firefox 中也得到了相同的结果。
在此站点上:http://keithclark.co.uk/articles/pure-css-parallax-websites/ 作者描述了一种变通方法:
It is possible to work around for this bug by anchoring the transform-origin and perspective-origin to the right hand side of the viewport:
.parallax {
perspective-origin-x: 100%;
}
.parallax__layer {
transform-origin-x: 100%;
}
但这并没有起到作用。
我在 jsfiddle
中收集了这个
有什么建议吗?
提前致谢。
微调 #container
的 left
属性 即可:
left: -7px;
替换宽度:100%;按宽度:100vw;在.background
我对纯 css 视差效果有一个奇怪的问题。我遵循了本教程:https://css-tricks.com/tour-performant-responsive-css-site/
但是就像在示例中一样,我在左侧站点上有一个白色 space。经过一些研究,我读到这应该是基于 webkit 的浏览器中独有的错误,但我在 firefox 中也得到了相同的结果。
在此站点上:http://keithclark.co.uk/articles/pure-css-parallax-websites/ 作者描述了一种变通方法:
It is possible to work around for this bug by anchoring the transform-origin and perspective-origin to the right hand side of the viewport:
.parallax {
perspective-origin-x: 100%;
}
.parallax__layer {
transform-origin-x: 100%;
}
但这并没有起到作用。
我在 jsfiddle
中收集了这个有什么建议吗?
提前致谢。
微调 #container
的 left
属性 即可:
left: -7px;
替换宽度:100%;按宽度:100vw;在.background