Is there anyway to resize an image without distorting it?
I have a 70px thumbnail image and I need to resize it to 200px X 165px while maintaining the aspect ratio. At the moment it stretches it when I set the width: 200px and height: 165px.
Here is the code:
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>';