CSS Image Filters in Internet Explorer

Written by David Walsh on Wednesday, March 26, 2008


Internet Explorer provides for some really interesting CSS image effects. Of course, these effects are useless in any other browser (just how Microsoft intended) but they should be used like any other browser-dependent functionality — used as enhancements only.

Note: Only IE users will see these image effects. Please switch to IE to experience the image effects.

Original Image

Horizontal Flip

.hflip	{ filter:fliph; }

Vertical Flip

.vflip	{ filter:flipv; }

The Wave

.wave { filter:wave(add = 0, freq = 5, lightstrength = 10, phase = 100, strength = 20); }

Frame Fade

.frame	{ filter:alpha(opacity = 100, finishopacity = 0, style = 3, startx = 20, starty = 40, finishx = 0, finishy = 0); }

X-Ray / Inverse

.xray { filter:xray; }

Blur

.blur { filter:blur(add = 0, direction = 300, strength = 10); }

Grayscale

.gray { filter:gray; }

Follow via RSS Epic Discussion

Commenter Avatar March 26 / #
Tony says:

I like the effects, gives you more management to the images which are one of the type of contents that are not available to manipulate in css (including objects{videos, animations…}).

Sad that IE can give you manipulation in this, but it doesn’t get better in supporting more transparency in png images.

Commenter Avatar March 26 / #
Rob says:

Cute, but IE can’t do much of anything else right, so why bother? With every other browser near passing Acid3, while IE8 still struggles with basic properties, you should make an article about the multitude of standard things that can be done on every other browser but doesn’t work on IE.

Commenter Avatar March 26 / #

These are interesting. Don’t forget about DropShadow(color,offX,offY)! Note that this will prevent your CSS from validating but neat effects.

Commenter Avatar March 26 / #
pfwd says:

Nice, Just wish IE would support more common image styles like Tony mentioned instead of making their own ones up.
However saying that IE8 is getting better in CSS support than IE7/6.
Does anyone know of a way of doing this in FF i wonder?

Commenter Avatar March 27 / #

@pfwd:

So I think that FF3 was going to have a similar feature called image filters but it got pulled. Maybe FF4?

Commenter Avatar April 01 / #
Dan says:

The only way I know of doing it so it works cross-browser is to use 2 separate images and do a rollover, which of course can be done using pure CSS with no javascript (in case user has scripting disabled). Example:

div#01 //set an id for the div
{
height: XXpx; //where XX is your actual dimension
width: XXpx; //ditto
background-image: url(‘image_a.jpg’);
display: block;
}

div#01:hover
{
background-image: url(‘image_b.jpg);
}

.hide //define a class for image preload
{
display: none;
}

In your HTML:

<img src=”image_b.jpg” class=”hide”> <!– This preloads the rollover image –>
<div id=”01″></div>

I’ve tried this in IE, Firefox, abd Safari and it works in all 3

Be Heard!

I want to hear what you have to say! Share your comments and questions below.

Name*:
Email*:
Website:  


© David Walsh 2007-2010. Contact David Walsh. Powered by the remarkable MooTools javascript framework.