IE6不支援透明的PNG圖片,有灰白底色,ie6不支援png底色

來源:互聯網
上載者:User

IE6不支援透明的PNG圖片,有灰白底色,ie6不支援png底色

解決方案:

1. 濾鏡

IE瀏覽器中特有的濾鏡效果,且必須將png檔案作為背景映像.

Filter:progid:DXImageTransform.Microsoft.AlphaImageLoader(enabled=true,src=string,sizingMethod)是否啟用濾鏡效果.背景映像的顯示方式

Image:放大或縮小盒子尺寸,以顯示整個背景映像.

Crop:裁切圖片以適應對象尺寸.

Scale:縮放圖片以適應對象尺寸.

#box{ // 針對IE

  Width:152px;

  Height:152px;

 Filter:progid:DXImageTransform.Microsoft.AlphaImageLoader(src=”PNG映像的URL” ,sizingMethod=image)

}

Html>body #box{ // 針對非IE

        Background:url(images/circle.png);

}

1. JS+透明gif

引用外部的JS檔案,(只針對文檔中的圖片png ,對背景無效)

<script type=”text/javascript” src=””></script>

2. DD_belatedPNG

前兩個不支援background-position,background-repeat

<!--[if IE6]>

<script type=”text/javascript”src=”js/DD_belatedPNG_0.0.8a-min.js”>

</script>

<script>

DD_belatedPNG.fix(‘css選取器,應用類型’);

</script>

<!--[endif]-->

例如:fix(‘#box,img’) , fix(‘#box,background’).

在使用方式情節一為背景映像添加連結時,在IE6中,背景映像的非空白地區不能觸發連結,解決方案:為連結添加position:relative;屬性.

聯繫我們

該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在5個工作日內處理。

如果您發現本社區中有涉嫌抄襲的內容,歡迎發送郵件至: info-contact@alibabacloud.com 進行舉報並提供相關證據,工作人員會在 5 個工作天內聯絡您,一經查實,本站將立刻刪除涉嫌侵權內容。

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.