change width of image (problem in IE)

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
arbitter
Forum Newbie
Posts: 24
Joined: Tue Dec 29, 2009 10:04 am

change width of image (problem in IE)

Post by arbitter »

So, I used to use <img src="image" style="max-width: 60%">

But that didn't really work. (Worked in Chrome i think, or at least worked on my localhost, not sure if it worked on site)

So I changed it to
<img src="image" width='60%' height='*'>

But this only works in Chrome, ff and safari, not in IE (I dont know in any other browsers)

How can I fix this, using css/php/html?

Not a hard answer, but I've been searching and can't really find a way that does it properly...
User avatar
Christopher
Site Administrator
Posts: 13596
Joined: Wed Aug 25, 2004 7:54 pm
Location: New York, NY, US

Re: change width of image (problem in IE)

Post by Christopher »

It sounds like an IE6 problem, but you might want to try styling it like div img {width: 50%;}
(#10850)
arbitter
Forum Newbie
Posts: 24
Joined: Tue Dec 29, 2009 10:04 am

Re: change width of image (problem in IE)

Post by arbitter »

Well, it's not only Internet Explorer 6, also 8. So I guess all of them. And I can't find a simple, for me to understand solution anywhere.

So this div img{}; does the div go around the image exactly then? I was thinking about doing it with div's, but how I'd done it, it'd be the same as trying to solely change a image width.
Post Reply