Is there a way to resize an image without distortion?
I am struggling with resizing a 70px thumbnail image to 200px X 165px while maintaining the aspect ratio. Currently, when I set the width to 200px and height to 165px, it stretches the image.
Below is the code snippet:
CSS
.listing-img-div {
width: 200px;
height: 165px;
}
.listing-img {
border: 1px solid black;
margin-top: 5px;
border: 1px solid #ddd;
width: 100%;
height: 100%;
}
HTML/PHP
echo '<div class="listing-img-div">';
echo '<img class="listing-img" src="'.$img.'" alt="'.$title.'">'; echo '</div>';