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

Code Example 1

img {
  width: width;
  height: height;
}

Code Example 2

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 3

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 4

div {
  height: 
200px;
  width: 50%;
  background-color: powderblue;
}

Code Example 5

/****************** 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 6

body {
  background-position: center;
  background-repeat: no-repeat;
  background-size: contain;
}

Learn ReactJs, React Native from akashmittal.com