解决"ie6下png透明图片"的兼容问题之滤镜+hack方法

PNG ( Portable Network Graphics ) 格式的无损压缩和半透明特性对增强网页效果减少网页体积有着重要的作用,但由于 IE6 不支持 PNG,所以一直未能得到广泛的应用。虽然 IE7 已经支持 PNG,但目前 IE6 还是主流,怎么样让 IE6 也使用 PNG 呢?网上有相关的介绍,下面我也尝试做一下介绍,希望在表达上能更加通俗易懂。

IE5.5+ 的 AlphaImageLoader 滤镜为 PNG 提供良好的支持,虽然 IE5.0 无法支持,但毕竟是非常非常小的一部分,将来会更小,因此我们不考虑。

滤镜的语法:

filter: progid: DXImageTransform.Microsoft.AlphaImageLoader ( enabled=bEnabled, sizingMethod=sSize, src=sURL )

属性:

enabled: 可选项,布尔值(Boolean)。设置或检索滤镜是否激活。true | false

true: 默认值,滤镜激活。

false: 滤镜被禁止。

sizingMethod: 可选项。字符串(String)。设置或检索滤镜作用的对象的图片在对象容器边界内的显示方式。

crop: 剪切图片以适应对象尺寸。

image: 默认值。增大或减小对象的尺寸边界以适应图片的尺寸。

scale: 缩放图片以适应对象的尺寸边界。

src: 必选项。字符串(String)。使用绝对或相对 url 地址指定背景图像。假如忽略此参数,滤镜将不会作用。

使用方法:

html>body #png{background:url(images/bg.png) no-repeat;} /* FF,Opera */

*html #png{filter:progid:DXImageTransform.Microsoft.AlphaImageLoader(enabled=true,sizingMethod=scale,src="images/bg.png");background:none;} /* IE5.5+~IE7+ */

Firefox,Opera 支持 PNG ,使用“>”子选择器识别,而IE不识别该选择器(包括IE7)。

虽然 IE7 支持 PNG,但方便起见,还是采用滤镜,使用通配符“*”,该通配符只有 IE 才能识别。

不过使用该滤镜,区域内的超链接按钮等将会失效,解决办法?使用“position”使它们浮在上面。

最新评论:

no.116439 shhtold 77.89.251.138 2020-03-31 19:19

[url=https://www.instagram.com/batmanapollo/]Психолог онлайн[/url] https://www.instagram.com/batmanapollo/ <a href="https://www.instagram.com/batmanapollo/">Психолог онлайн</a>

no.116433 ssvhvjv 83.219.139.66 2020-03-31 16:42

[url=https://www.instagram.com/batmanapollo/]Психолог онлайн[/url] https://www.instagram.com/batmanapollo/ <a href="https://www.instagram.com/batmanapollo/">Психолог онлайн</a>

no.116425 hdzcgzl 190.226.46.114 2020-03-31 11:39

[url=https://www.instagram.com/batmanapollo/]Психолог онлайн[/url] https://www.instagram.com/batmanapollo/ <a href="https://www.instagram.com/batmanapollo/">Психолог онлайн</a>

no.116407 tcnsxfg 195.234.215.81 2020-03-31 02:01

[url=https://www.instagram.com/batmanapollo/]Психолог онлайн[/url] https://www.instagram.com/batmanapollo/ <a href="https://www.instagram.com/batmanapollo/">Психолог онлайн</a>

no.116391 iahqsvc 103.95.172.10 2020-03-30 15:29

[url=https://www.instagram.com/batmanapollo/]Психолог онлайн[/url] https://www.instagram.com/batmanapollo/ <a href="https://www.instagram.com/batmanapollo/">Психолог онлайн</a>

no.116365 qxvidda 177.91.35.14 2020-03-30 00:47

[url=https://www.instagram.com/batmanapollo/]Психолог онлайн[/url] https://www.instagram.com/batmanapollo/ <a href="https://www.instagram.com/batmanapollo/">Психолог онлайн</a>

no.116351 mpgwheh 91.244.253.66 2020-03-29 16:45

[url=https://www.instagram.com/batmanapollo/]Психолог онлайн[/url] https://www.instagram.com/batmanapollo/ <a href="https://www.instagram.com/batmanapollo/">Психолог онлайн</a>

no.116311 rjvfqsa 203.153.119.242 2020-03-28 15:18

[url=https://www.instagram.com/batmanapollo/]Психолог онлайн[/url] https://www.instagram.com/batmanapollo/ <a href="https://www.instagram.com/batmanapollo/">Психолог онлайн</a>

no.116305 bjgcycq 109.86.225.146 2020-03-28 12:43

[url=https://www.instagram.com/batmanapollo/]Психолог онлайн[/url] https://www.instagram.com/batmanapollo/ <a href="https://www.instagram.com/batmanapollo/">Психолог онлайн</a>

no.116298 itxvqop 177.129.202.92 2020-03-28 07:42

[url=https://www.instagram.com/batmanapollo/]Психолог онлайн[/url] https://www.instagram.com/batmanapollo/ <a href="https://www.instagram.com/batmanapollo/">Психолог онлайн</a>

no.116283 finvenr 79.106.34.2 2020-03-28 00:22

[url=https://www.instagram.com/batmanapollo/]Психолог онлайн[/url] https://www.instagram.com/batmanapollo/ <a href="https://www.instagram.com/batmanapollo/">Психолог онлайн</a>

no.116241 cvcaicv 45.226.135.65 2020-03-26 22:52

[url=https://www.instagram.com/batmanapollo/]Психолог онлайн[/url] https://www.instagram.com/batmanapollo/ <a href="https://www.instagram.com/batmanapollo/">Психолог онлайн</a>

no.116216 baqrgmv 95.133.163.98 2020-03-26 10:06

[url=https://www.instagram.com/batmanapollo/]Психолог онлайн[/url] https://www.instagram.com/batmanapollo/ <a href="https://www.instagram.com/batmanapollo/">Психолог онлайн</a>

no.116212 iwmkryh 101.255.55.10 2020-03-26 07:42

[url=https://www.instagram.com/batmanapollo/]Психолог онлайн[/url] https://www.instagram.com/batmanapollo/ <a href="https://www.instagram.com/batmanapollo/">Психолог онлайн</a>

no.116201 ryfeffl 182.253.22.27 2020-03-26 02:33

[url=https://www.instagram.com/batmanapollo/]Психолог онлайн[/url] https://www.instagram.com/batmanapollo/ <a href="https://www.instagram.com/batmanapollo/">Психолог онлайн</a>

no.116195 uonaseo 36.67.204.214 2020-03-25 22:09

[url=https://www.instagram.com/batmanapollo/]Психолог онлайн[/url] https://www.instagram.com/batmanapollo/ <a href="https://www.instagram.com/batmanapollo/">Психолог онлайн</a>

no.116179 zlpcgmi 179.127.152.6 2020-03-25 14:19

[url=https://www.instagram.com/batmanapollo/]Психолог онлайн[/url] https://www.instagram.com/batmanapollo/ <a href="https://www.instagram.com/batmanapollo/">Психолог онлайн</a>

no.116173 okytika 191.241.226.173 2020-03-25 11:49

[url=https://www.instagram.com/batmanapollo/]Психолог онлайн[/url] https://www.instagram.com/batmanapollo/ <a href="https://www.instagram.com/batmanapollo/">Психолог онлайн</a>

no.116153 jkwzsqx 79.106.34.2 2020-03-25 04:20

[url=https://www.instagram.com/batmanapollo/]Психолог онлайн[/url] https://www.instagram.com/batmanapollo/ <a href="https://www.instagram.com/batmanapollo/">Психолог онлайн</a>

no.116149 reypufr 103.15.60.190 2020-03-25 01:45

[url=https://www.instagram.com/batmanapollo/]Психолог онлайн[/url] https://www.instagram.com/batmanapollo/ <a href="https://www.instagram.com/batmanapollo/">Психолог онлайн</a>

no.116137 ygyrjne 95.86.32.4 2020-03-24 18:39

[url=https://www.instagram.com/batmanapollo/]Психолог онлайн[/url] https://www.instagram.com/batmanapollo/ <a href="https://www.instagram.com/batmanapollo/">Психолог онлайн</a>

no.116105 btwjcwp 191.37.0.192 2020-03-24 02:53

[url=https://www.instagram.com/batmanapollo/]Психолог онлайн[/url] https://www.instagram.com/batmanapollo/ <a href="https://www.instagram.com/batmanapollo/">Психолог онлайн</a>

no.116101 eofynrx 175.41.44.36 2020-03-24 00:25

[url=https://www.instagram.com/batmanapollo/]Психолог онлайн[/url] https://www.instagram.com/batmanapollo/ <a href="https://www.instagram.com/batmanapollo/">Психолог онлайн</a>

no.116080 qtqelxr 166.62.43.174 2020-03-23 11:33

[url=https://www.instagram.com/batmanapollo/]Психолог онлайн[/url] https://www.instagram.com/batmanapollo/ <a href="https://www.instagram.com/batmanapollo/">Психолог онлайн</a>

no.116043 vkuszev 118.69.56.68 2020-03-22 15:18

[url=https://www.instagram.com/batmanapollo/]Психолог онлайн[/url] https://www.instagram.com/batmanapollo/ <a href="https://www.instagram.com/batmanapollo/">Психолог онлайн</a>

no.116028 hsrdfkx 125.26.108.12 2020-03-22 10:11

[url=https://www.instagram.com/batmanapollo/]Психолог онлайн[/url] https://www.instagram.com/batmanapollo/ <a href="https://www.instagram.com/batmanapollo/">Психолог онлайн</a>

no.116018 ihlsofs 91.106.90.134 2020-03-22 07:18

[url=https://www.instagram.com/batmanapollo/]Психолог онлайн[/url] https://www.instagram.com/batmanapollo/ <a href="https://www.instagram.com/batmanapollo/">Психолог онлайн</a>

no.115956 fglsdfr 36.71.8.81 2020-03-17 02:55

https://qa.easykassa.ru/en/vopros/23520/trigger-16-ia-seriia-vse-serii-podriad-onlain-v-khoroshem-kachestve/

no.115946 socyekx 202.51.120.22 2020-03-16 23:08

https://qa.easykassa.ru/en/vopros/23520/trigger-16-ia-seriia-vse-serii-podriad-onlain-v-khoroshem-kachestve/

no.115920 gzhewmq 186.219.3.3 2020-03-13 06:31

https://qa.easykassa.ru/en/vopros/23520/trigger-16-ia-seriia-vse-serii-podriad-onlain-v-khoroshem-kachestve/

no.115910 uqaocok 159.224.194.220 2020-03-13 02:57

https://qa.easykassa.ru/en/vopros/23520/trigger-16-ia-seriia-vse-serii-podriad-onlain-v-khoroshem-kachestve/

no.115909 oaqavpn 36.84.59.53 2020-03-13 02:47

https://qa.easykassa.ru/en/vopros/23520/trigger-16-ia-seriia-vse-serii-podriad-onlain-v-khoroshem-kachestve/

no.115906 ycopies 77.89.207.22 2020-03-13 00:08

https://qa.easykassa.ru/en/vopros/23520/trigger-16-ia-seriia-vse-serii-podriad-onlain-v-khoroshem-kachestve/

no.115896 v5086viar 94.136.157.114 2020-03-12 11:01

canada online pharmacy approved canadian online pharmacies [url=https://uscanadianpharmacies.com/#]online canadian pharmacies[/url] canadian drug online pharmacy canada <a href="https://topedstoreusa.com/#&quot;&gt;canada online pharmacy&lt;/a&gt; canada pharmacy online canadian pharmacy reviews

no.115883 h2149viad 182.52.51.154 2020-03-11 17:18

canadian pharmacy without prescription my canadian pharmacy [url=https://uscanadianpharmacies.com/#]canada pharmacies online[/url] walmart prescription prices online prescription <a href="https://topedstoreusa.com/#&quot;&gt;drugstore online&lt;/a&gt; canadian prescription drugs online pharmacy without prescription

no.115867 r3509viaf 103.79.74.26 2020-03-11 02:15

online pharmacy canadian pharmacy online [url=https://uscanadianpharmacies.com/#]canadian pharmacies[/url] online canadian pharmacy online pharmacy canada <a href="https://topedstoreusa.com/#&quot;&gt;cheap medications&lt;/a&gt; canadian prescription prices cheap medications

no.115847 bfsgbsw 104.237.227.198 2020-03-09 21:53

208895 610626 959590 https://www.infolabiopalatoschisi.it/forums/users/ashleyrobe8/edit/?updated=true/users/ashleyrobe8/ 263263 701503 90676

no.115823 ntijocj 93.88.107.125 2020-03-08 11:01

942668 796945 101211 https://www.militarywom.com/uncategorized/%d0%b4%d0%b6%d0%b5%d0%bd%d1%82%d0%bb%d1%8c%d0%bc%d0%b5%d0%bd%d1%8b-%d1%81%d0%bc%d0%be%d1%82%d1%80%d0%b5%d1%82%d1%8c-%d1%8e%d1%82%d1%83%d0%b1-2/ 192062 401200 950798

no.115812 ocebgvx 58.215.120.178 2020-03-07 10:26

839732 710407 853742 https://www.mercadaocantu.com.br/user/profile/404833 611934 116759 755596

no.115804 llwrewb 158.46.127.222 2020-03-07 03:08

718240 284949 979210 https://sound-works.net/user/profile/363538 333631 720713 915919

no.115796 miqajas 109.75.34.183 2020-03-06 11:45

998751 843003 839244 https://www.immo-web.ro/user/profile/30017 183596 920566 235726

no.115772 yzrqwvx 45.70.248.14 2020-03-04 19:35

875402 734631 933176 https://www.datingadvice.com/forum/users/rosemariebarreto/edit?updated=true/users/rosemariebarreto/ 243986 209422 977160

no.115711 ihmxihz 36.66.99.205 2020-03-01 15:39

[url=https://4serial.com/] Ангелы Чарли 2019 фильм 2020 смотреть онлайн 1080. [/url]

no.115703 okewwra 176.210.99.14 2020-03-01 13:10

[url=https://www.tvonlayn.ru/] Достать ножи фильм 2020 смотреть онлайн русский. [/url]

no.115696 qdhiakh 92.38.44.232 2020-03-01 08:12

[url=https://www.wwin-tv.com/] Обратный отсчет 2019 2020 смотреть онлайн +в hd 1080. [/url]

no.115677 xtddkvq 138.99.93.224 2020-02-28 08:53

[url=https://zfilm2.ru/] Аладдин 2019 2020 смотреть онлайн +в hd 1080. [/url]

no.115667 vvcamqm 201.161.223.150 2020-02-27 20:13

[url=https://zfilm2.ru/] Комната желаний 2020 смотреть онлайн на русском. [/url]

no.115648 ahjxchw 177.72.80.46 2020-02-26 18:27

[url=https://imdb1.ru/] Текст 2019 фильм 2020 смотреть онлайн 1080. [/url]

no.115633 vjwzboo 188.235.255.70 2020-02-26 08:18

[url=https://www.4serial.com/] Мысленный волк 2020 смотреть онлайн качество 1080. [/url]

no.115622 ulxcpzw 190.64.147.19 2020-02-26 03:12

[url=https://wwin-tv.com/] Мой шпион 2020 смотреть онлайн полностью. [/url]

发表评论:

邮箱: