While using Material design responsive image I noticed even if I give fixed width to col
, its size decreases as the container width decreases. I have breaked it down to a reproducible snippet:
.row {
width: 80%;
border: 1px dotted red;
margin: 5px;
display: flex;
}
.col {
float: left;
}
.pic {
width: 80px;
}
.pic img {
max-width: 100%;
height: auto;
}
<div class="row">
<div class="col pic">
<img src="https://s-media-cache-ak0.pinimg.com/236x/e1/38/a1/e138a174c33a48931521dcc5639d4a03--happy-pictures-smiley-faces.jpg" alt="">
</div>
<div class="col"> Resize the window to decrease it's width. When the text starts wrapping to second line the image starts shrinking</div>
</div>
jsfiddle: https://jsfiddle.net/2fbcggd8/
To see the problem try resizing the jsfiddle output section(right bottom). You'll notice the image which should be fixed 80px width decreases in size as the text wraps to second line. Why does this happen?