How can I auto fit an image in a div. I have a div inside which there is an image. If the image is big then it takes up half of the screen. I want it so that the image is shrunk and fits in a div of 150px or so. So as along as the image has a height of 150px, then the image will fit in the box. if it is bigger then it should shrink.
I tried:
.crop {
  height: 150px;
  overflow: hidden;
  position: absolute;
}
But doesnt work. I also tried max-width: 1fr `
 
     
     
     
     
     
    