Possible Duplicate:
Set image max size
I have an area of 100x150 px
to display an image.
If the image to display is larger than this area, it should be resized (constraining width and height) to fit in the area, however when it is smaller than the area, it should remain in the original size.
Is this possible to do in HTML
? or do I need to resize the image in serverside?
Just specify the max-width
and max-height
styles:
img {
max-width: 100px;
max-height: 150px;
}
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With