Hello i want to show the full image in a specified height div like this

        <div style="width:400px"> <img class="images" src="someimage.jpg"> </div>

i tried this

    width: 100%;

but it crops the image it doesnt show the full image in height and width

You say "in a specified height of div", but you havent specified a height on that div, so what's the problem?

Also what you have here on HTML & CSS, it doesn't crop the image.

Hi, please try this code:


  <img src="https://www.w3schools.com/images/picture.jpg">


div {
   width: 50px; 
   height: 50px;

div img {
   height: 100%;
   width: 100%;