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

Code Example 1

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

Code Example 2

background-image: url('images/my-image.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

.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 5

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

Code Example 6

<img src="smiley.gif" alt="Smiley face" width="42" height="42" style="vertical-align:bottom">

    <img src="smiley.gif" alt="Smiley face" width="42" height="42" style="vertical-align:middle">

    <img src="smiley.gif" alt="Smiley face" width="42" height="42" style="vertical-align:top">

    <img src="smiley.gif" alt="Smiley face" width="42" height="42" style="float:right">

    <img src="smiley.gif" alt="Smiley face" width="42" height="42" style="float:left">

Learn ReactJs, React Native from akashmittal.com