I have two floated left divs.. One with width = 20% Another with width = 80%
Inside this 20% width div I have an image with 300px width...
If my 20% area is smaller then 300px, I would like to make my image resize and fits inside this 20% div...
Something like this:
<div class="container">
   <div style="float:left; width:20%;">
       <img src="imageWith300pxWidth.jpg" />
   </div>
   <div style="float:left; width:80%;"></div>
</div>
.image {
  width: 100%;
  max-width: 300px;
}
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With