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

Code Example 1

background-image: url('images/my-image.png');

Code Example 2

.element {
  background-image: url("imageFile.png");
}

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

squareImage {
  border: 1px solid #ddd;	/* thickness and color of border */
  border-radius: 4px;		/* edge rounding of border */
  width: 150px;				/* width of image (px or % or auto) */
  height: auto;				/* height of image (px or % or auto) */
}

Code Example 5

.parent {
  position: relative;
  top: 0;
  left: 0;
}
.image1 {
  position: relative;
  top: 0;
  left: 0;
  border: 1px red solid;
}
.image2 {
  position: absolute;
  top: 30px;
  left: 30px;
  border: 1px green solid;
}

Code Example 6

img {
  width: width;
  height: height;
}

Learn ReactJs, React Native from akashmittal.com