(CSS) Make a background image scroll slower than everything else

后端 未结 8 1089
死守一世寂寞
死守一世寂寞 2020-12-12 17:33

here is is my CSS code for the body:

body {
  padding: 0;
  margin: 0;
  background-image: url(\"../images/background.jpg\");
  background-repeat: no-repeat;         


        
8条回答
  •  萌比男神i
    2020-12-12 17:43

    Best way is to do it with jQuery. There are a lot of sites about this, for example:

    • jQuery to give impression of background scrolling slower
    • http://code.tutsplus.com/tutorials/a-simple-parallax-scrolling-technique--net-27641
    • http://callmenick.com/2014/09/08/advanced-parallax-scrolling-effect/

提交回复
热议问题