Here is what I am trying to do… I have a database with multiple entries. Each entry contains a link to an image from another website. Each image varies in size. I would like to display the images on my website (keeping the aspect ratio). The area on my website to display the images, for example, is 100x by 100y. I would like to view 100% of my image (no overflow).
I would like something that makes the image display as 100x width and auto-height if the width > height; and display as 100y height and auto-width if the height > width.
Since I am not hosting the images, I can’t do an if/else statement in my code, and figure that CSS may be my best hope. (I have found how to do close to what I want:
[code=php]<style>
#image_container
{
width:10em;
height:10em;
border:3px double #999;
}
#image_container img
{
width:100%;
height:auto;
}
</style>
The issue being that if the image is taller than it is wide, the image overflows. If there is another way to look at this, I’m open to suggestions.