• IE滤镜实现透明度/阴影/渐变等特效整理资料


    透明度

    最为开发者所熟知的滤镜之一。

    #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 */
    }
    View Code

    阴影

    .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 ); }
    View Code

    渐变

    #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' )"; 
    }
    View Code

    背景色透明

    #rgba p {
    /* other browsers */
    background: rgba( 98, 135, 167, .4 ); 
    /* IE */
    filter: progid:DXImageTransform.Microsoft.gradient( GradientType = 0,startColorstr = '#886287a7', 
    endColorstr = '#886287a7' ); 
    }
    View Code

    多背景

    #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')"; 
    }
    View Code

    旋转

    #rotate {
    -webkit-transform: rotate(180deg); /* Safari and Chrome */
    -moz-transform: rotate(180deg); /* Firefox */
    filter: progid:DXImageTransform.Microsoft.BasicImage(rotation = 2); /* IE */
    }
    View Code

    备注:IE 系列采用滤镜必须配合background属性一起使用filter才有效,另外在IE6、IE7中还须配合width/height,filter放可生效。

    原文链接.http://www.nowamagic.net/csszone/css_IeFilterTransparencyShadowsEtc.php

    CSS实现兼容性的渐变背景(gradient)效果:

  • 相关阅读:
    webuploader 断点续传
    mysql 基本操作语句
    centos 安装apache 和 php5.6
    centos 安装 apache2.4
    centos 安装和配置 rabbitmq
    安装 webpack
    DevExpress v20.1汉化包
    DevExpress DisplayFormat格式化操作
    No cached version of com.android.tools.build:gradle:3.6.2 available for offlin 解决办法
    VUE 修复IOS手机URL问题
  • 原文地址:https://www.cnblogs.com/yyman001/p/ie_filter_css.html
Copyright © 2020-2023  润新知