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

Code Example 1

background-image: url("image.png");
background-position: center;
background-repeat: no-repeat;
background-size: cover;

Code Example 2

body
{
  background-image: url("img.jpg");
  background-repeat: no-repeat;
  background-attachment: fixed;
  background-size: 100% 100%;
}

Code Example 3

/****************** How to set a background image? *********************/

div {
  background-image: url(path_to_image or url);
  background-size: 100% 100%;  /* This way, the image fills the entire space of the box */
  background-repeat: no-repeat; /* if the image will repeat or not, in case it is smaller than the box */
  background-position: center; /*  defines the image position inside the box */
  background-origin: content-box; /* defines where the image boundaries are positioned, for example, on the <div> border, or in the <div> content, ... (the background positioning area)*/
   
}

Code Example 4

body {
 background-image: url("paper.gif");

}

Code Example 5

background-image: url("image.png");
background-position: center;
background-repeat: no-repeat;
background-size: cover;

Code Example 6

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

Learn ReactJs, React Native from akashmittal.com