|
Pages: [1] |  |
|
|
Author
|
Topic: CSS to limit maximum size of image (Read 1700 times)
|
 Joined: Jan 2008 Posts: 43

 United States
|
Mar 18, 2008, 04:26:56 AM | #1 |
I'm currently working on a web application which (among other things) allows the user to browse a catalogue of products. Each product has an associated image, which should be shown next to the description on the screen. Images and product text are supplied by a third party.
All this is fine and dandy, until the supplied image is too large for the space allocated on the web page, when it completely screws up the text flow and pushes important information into invisibility. I have experimented with setting the height and width explicitly on the image tag, but this stretches small images and makes them look horrible.
I have little or no possibility of changing the appearance, box sizes, text flow or other on-screen stuff (it's all produced by the customer's high-power, high-price web designers), but I can add extra "invisible" JS/CSS behaviour if necessary.
What I would ideally like, is a way of showing an image at its "natural" resolution if both dimensions are smaller than a set limit, but downsizing the image to fit if it is too big. IE support is vital, Firefox important, other browsers nice to have.
Does anyone have any hints as to how I might achieve this? Is it even possible?
Many thanks in advance for any suggestions. |
|
|
|
|
| |
|
|
|
|
|
|
|
 Joined: Oct 2009 Posts: 14

|
Oct 15, 2009, 04:32:36 PM | #5 |
|
|
|
|
 Joined: Sep 2011 Posts: 30
 
United Kingdom
|
Oct 05, 2011, 05:43:58 PM | #6 |
| Use css poperty min-width:600px; max-width:700px; you can put whatever dimention you want |
|
|
|
|
 |
|
Pages: [1]
|
|
|
 |