Check out example codes for "Scaling Images and Videos css". It will help you in understanding the concepts better.

Code Example 1

.container {
  width: 50%;
  height: 200px;
  overflow: hidden;
}

.container img {
  max-width: 100%;
  height: auto;
  display: block;
}

Learn ReactJs, React Native from akashmittal.com