Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How can you make images resized with css look good in IE?

IE6 and IE7 don't scale images nicely in web pages when the images are scaled with css width/height or attribute width/height. I am not sure which algorithm it uses by default, but it's not good.

Scaled images display aliasing artifacts when scaled in these browsers.

like image 958
apinstein Avatar asked Mar 25 '09 13:03

apinstein


People also ask

How do I resize an image without losing quality CSS?

Use object fit property in your css, and give a fixed width and height to your image tag or respective class so that every image will have same width and height, Now Your Image won't be distorted.

How do I make an image fit my CSS size?

Using CSS, you can set the background-size property for the image to fit the screen (viewport). The background-size property has a value of cover . It instructs browsers to automatically scale the width and height of a responsive background image to be the same or bigger than the viewport.

How do I resize an image without losing quality?

If you want to resize an image without losing quality, you need to make sure that the "Resample" checkbox is unchecked. This checkbox tells Paint to change the number of pixels in the image. When you uncheck this box, Paint will not change the number of pixels, and the quality of the image will not be reduced.


1 Answers

Fortunately there's a way to force IE7 to use the bicubic scaling algorithm (which looks very nice) with a simple css rule:

img { -ms-interpolation-mode: bicubic; }

The results are great, and it can be done site-wide with this single rule.

For IE6 you're out of luck as far as I know.

like image 164
apinstein Avatar answered Nov 02 '22 05:11

apinstein