Aug 26, 2007
Max-width image solved for IE
I’m a Firefox user but that doesn’t matter. More than 80% of visitors use IE browser so when I tested my webpage in IE recently, the layout was out of places. That was due to the width of images that is larger than the width of post section. So I used max-width CSS attribute but it doesn’t work on IE. Luckily, I found this link that tells how to get around that.
.post-body img {
max-width:400px;
width: expression(this.width > 400 ? 400: true);
}
That’s all it takes to restrict images to a specific width for IE. Now my website is back in its proper layout.
Problem solved.


2 Comments, Comment or Ping
LaRonda
Thanks for this information. I, too, am a Mozilla Firefox user. My husband helped me figure it out so now my v/blog looks well proportioned on both IE and Firefox.
~ LaRonda
Aug 26th, 2007
natech
Cool! Nothing like husband and wife working together to solve problems. :-)
Aug 26th, 2007
Reply to “Max-width image solved for IE”