Say for example I have an image that preserves aspect ratio, ie, auto scaled with
img {
max-height:100%;
max-width:100%;
}
I now need to contain this inside a container which wraps it perfectly tight with something like
.wrapper{
height:100%;
width:100%;
background:pink; /*verify*/
}
But the wrapper leaves extra space at the corners. How could you solve this ? The HTML is as simple as
<div class="wrapper">
<img src="image.jpg"/>
</div>
Here's a snippet of the code:
img {
max-height:100%;
max-width:100%;
}
.wrapper{
height:100%;
width:100%;
background:pink; /*verify*/
}
<div class="wrapper">
<img src="https://picsum.photos/200/200"/>
</div>