Hi!
I am looking for a way to make an image resize down if there isn't enough
space, but not up.
ie, I have <div id=1>blah</div><div id=2><img id=i></div><div
id=3>blah</div>
#1,#3 {
width:35%
}
#2 {
width:30%
}
This fits fine.
I want if #2 is smaller than the pixel size of #i, #i is resized to fit
(like #i {width:100%}), but if the width of #2 is equal or greater, then it
sits in the middle, like #2{text-align:center} #i{width:auto}.
How can I do this so it works in IE 5+? The canonical answer would be to
set max-width to the pixel size, but IE can't do it.
No javascript unless it degrades gracefully please.
Thanks
Tom V
I am looking for a way to make an image resize down if there isn't enough
space, but not up.
ie, I have <div id=1>blah</div><div id=2><img id=i></div><div
id=3>blah</div>
#1,#3 {
width:35%
}
#2 {
width:30%
}
This fits fine.
I want if #2 is smaller than the pixel size of #i, #i is resized to fit
(like #i {width:100%}), but if the width of #2 is equal or greater, then it
sits in the middle, like #2{text-align:center} #i{width:auto}.
How can I do this so it works in IE 5+? The canonical answer would be to
set max-width to the pixel size, but IE can't do it.
No javascript unless it degrades gracefully please.
Thanks
Tom V
Comment