Notice: Undefined variable: ob in /srv/www/idiotechnica.com/dev_checkout/source/classes/lib.forum_posts.php on line 102
SELECT SQL_CALC_FOUND_ROWS forum_posts.*, forum_threads.name as thread_name, CONVERT_TZ(forum_posts.created_date, '+00:00', '-4:00') as forum_posts_created_date_tz FROM forum_posts, forum_threads WHERE TRUE AND forum_threads.thread_id = forum_posts.thread_id AND forum_posts.disabled = 0 AND forum_posts.thread_id = 815 ORDER BY forum_posts.created_date ASC LIMIT 0, 20 CSS Max Width Image Probem IE7
email:
password:

Register
Forum Stats
Total Threads:
4104

Total Posts:
10050

Top Posters
Michael 2304
Dylan 1805
onemiamibum 710
JennyJM 645
nicole 484
Francisco 301
m1nr 262
Marty 256
dav 199
kyle 176
Fla 155
ultron 146
henryjoebob 142
Xandy 133
manic 127
Jess 124
Sarah 123
Cindy 123
Adam 106
Jessica 104
Random Faqqing
What does Beta mean and how long will idiotechnica.com be in it?
Beta is a fancy schmancy technical term that means: We do not want to take any responsibility for the quality of our software at this time. Idiotechnica will always be in beta.
firefox_logo
idiotechnica.com uses CSS3 and is optimized for viewing in Firefox versions 3+

Posts: Computers and Technology / CSS Max Width Image Probem IE7

share this thread on facebook

Michael Post Author Photo: Michael
CSS Max Width Image Probem IE7
10/08/09 06:57 PM

While Internet Explorer 6 supposedly has no support for max-width, IE7 at the very least recognizes it. So does IE8. Unfortunately, they only partially recognize it.

The bug so far as I can tell from my observations is that all containing elements for an image with a max-width set will act as if the image is full size even though IE appears to be respecting the max-width for the image itself.

so if i have a max-width of 100% set for all images and the image is naturally 500px in a div that is only 300 px, the image will be sized down to 300px...but the div its in will enlarge as if it was attempting to display the image at full size. i was able to hack around this using an older hack for emulating max width by using a css expression (supported by IE only) for the width.

my resulting img css definition looks like this
img { max-width:100%;width:expression(this.width > 500 ? 500: true);}

this isnt optimum as my container may be bigger than 500 or god forbid less in which but it does put a maximum value on the image that the containing elements respect. its more like a fail-safe value than anything, but it serves its purpose.

I got this hack from http://phydeaux3.blogspot...and-faking-it-for-ie.html
Offline
Post ID: 1874