Jump to content

Resizing image problem


robert_gsfame

Recommended Posts

Assume there are 3 users with different image (JPG) size

*400x100

*200x200

*100x400

 

and i display the image in 130x130 <img src="xx" height=130 width=130>

then how can i adjust each images so that fit 130x130 but without being stretched..

 

i mean if the image is rectangle then it will appear as rectangle but only the size percentage will be adjusted

 

thx

Link to comment
https://forums.phpfreaks.com/topic/205853-resizing-image-problem/
Share on other sites

Ideally you should resize the image. But you can try this:

 

<div class="image_container">
  <img src="img1.jpg" />
</div>
<div class="image_container">
  <img src="img2.jpg" />
</div>
<div class="image_container">
  <img src="img3.jpg" />
</div>

 

.image_container
{
  width:130px;
  height:130px;
}

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.