<分区>
这是我的视差滚动当前的样子:
我有这个:
background-image:url("http://google.com");
background-attachment: fixed;
我想要这个,但我不想使用“具体化 css”的东西:materializecss.com
当您向上或向下滚动页面时,background-image
会稍微移动。
<分区>
这是我的视差滚动当前的样子:
我有这个:
background-image:url("http://google.com");
background-attachment: fixed;
我想要这个,但我不想使用“具体化 css”的东西:materializecss.com
当您向上或向下滚动页面时,background-image
会稍微移动。
最佳答案
要获得这种视差效果,必须将背景图像放置在不同的元素上。这些元素还需要定义 background-attachment: fixed。通过定义背景附件,可以更改任何背景图像的行为和定位。
关于html - 背景图像移动的CSS视差滚动,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/40724293/