Check out example codes for "css background stays when scrolling". It will help you in understanding the concepts better.

Code Example 1

body {

    background-image: url("img_tree.gif");

   background-repeat: no-repeat;

   
 background-attachment: fixed;

 }

Code Example 2

body {
  background-image: url("img_tree.gif");
  
  background-position: center;
  background-repeat: no-repeat;
  background-attachment: fixed;
  
  background-size: cover;
}

Learn ReactJs, React Native from akashmittal.com