Click to See Complete Forum and Search --> : Non-resizable div


IxxI
04-26-2003, 05:55 PM
I have a div in which I display images. If the image is bigger than the div size, then the div resizes itself - is there any way to turn this around so that if the image is bigger than the div, then the image resizes itself.
Thanks,

IxxI

gil davis
04-26-2003, 09:14 PM
This works in IE 5.5:
<div style="width: 200; height: 200">
<img src="lilguy2.gif" width=100% height=100%>
</div>

IxxI
04-27-2003, 08:31 AM
Thanks for the reply gil, but is there a way to make so that if the image is smaller it does not resize itself - you see the div shows not just one but many pictures, and I want it so that if the image is small enough to fit in the div, then fine, but if it is too big then it makes itself smaller, does that make sense?
Thanks again,

IxxI

gil davis
04-27-2003, 10:22 AM
if the image is small enough to fit in the div, then fine, but if it is too big then it makes itself smallerYou should realize that if you need to use an IF statement in your question, then the answer will probably require some SCRIPT to accomplish your desires. CSS alone wil not accomplish your idea.

If you want a scripted answer, it woud be best to start a new post in the JS or DHTML forum.

IxxI
04-27-2003, 10:39 AM
Thanks...