透明度
最为开发者所熟知的滤镜之一。
#myElement { opacity: .4; /* other browsers */ filter: progid: DXImageTransform.Microsoft.Alpha( opacity=40 ); /* IE6, IE7, and IE8 */ -ms-filter : "progid:DXImageTransform.Microsoft.Alpha( opacity=40 )"; /* IE8 only */ }
阴影
.box-shadow { -moz-box-shadow: 2px 2px 3px #969696; /* Firefox */ -webkit-box-shadow: 2px 2px 3px #969696; /* Safari and Chrome */ filter: progid:DXImageTransform.Microsoft.Shadow( color='#969696', Direction=145, Strength=3 ); }
渐变
#gradient { /* Firefox 3.6 */ background-image: -moz-linear-gradient( top, #81a8cb, #4477a1 ); /* Safari & Chrome */ background-image: -webkit-gradient(linear , left bottom , left top , color-stop( 0, #4477a1 ) , color-stop( 1, #81a8cb )); /* IE6 & IE7 */ filter: progid:DXImageTransform.Microsoft.gradient( GradientType= 0 , startColorstr = '#81a8cb', endColorstr = '#4477a1' ); /* IE8 */ -ms-filter: "progid:DXImageTransform.Microsoft.gradient( GradientType = 0,startColorstr = '#81a8cb', endColorstr = '#4477a1' )"; }
背景色透明
#rgba p { /* other browsers */ background: rgba( 98, 135, 167, .4 ); /* IE */ filter: progid:DXImageTransform.Microsoft.gradient( GradientType = 0,startColorstr = '#886287a7', endColorstr = '#886287a7' ); }
多背景
#multi-bg { /* other browsers */ background:url(../images/Yomi.jpg) center center no-repeat, url(../images/body_bg.gif) top left repeat-x; /* IE */ backrgound:transparent url(../images/Yomi.jpg) center center no-repeat; /* IE6-8 */ filter:progid:DXImageTransform.Microsoft.AlphaImageLoader(src='../images/body_bg.gif',sizingMethod='crop') /* IE8 only */ -ms-filter: "progid:DXImageTransform.Microsoft.AlphaImageLoader(src = '../images/body_bg.gif', sizingMethod = 'crop')"; }
旋转
#rotate { -webkit-transform: rotate(180deg); /* Safari and Chrome */ -moz-transform: rotate(180deg); /* Firefox */ filter: progid:DXImageTransform.Microsoft.BasicImage(rotation = 2); /* IE */ }
备注:IE 系列采用滤镜必须配合background属性一起使用filter才有效,另外在IE6、IE7中还须配合width/height,filter放可生效。
原文链接.http://www.nowamagic.net/csszone/css_IeFilterTransparencyShadowsEtc.php