Responsive Images Scaling or Squishing Issues

I was setting up responsive images and ran into an issue that the images were being squished and squashed. And it was because the image tag had a height attribute set in HTML. It’s easy to overcome this with CSS though.


<style>
@media only screen and (max-width:959px) {
img {max-width:100%; height:auto !important;}
}
</style>
<img src="image.jpg" width="150" height="150" alt="my image">
</style>

Tags:

Leave a Comment

Comments are reviewed before publishing to prevent spam.