<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>IInterest &#187; png透明</title>
	<atom:link href="http://www.iinterest.net/tag/png%e9%80%8f%e6%98%8e/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.iinterest.net</link>
	<description>Design &#38; Develope 关注用户体验,追求以用户为中心的设计.</description>
	<lastBuildDate>Thu, 26 Aug 2010 15:17:54 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.0.1</generator>
		<item>
		<title>IE6下实现png图片半透明的常用方法</title>
		<link>http://www.iinterest.net/2009/11/13/transparent-png-in-ie6/</link>
		<comments>http://www.iinterest.net/2009/11/13/transparent-png-in-ie6/#comments</comments>
		<pubDate>Fri, 13 Nov 2009 09:57:21 +0000</pubDate>
		<dc:creator>Bell</dc:creator>
				<category><![CDATA[HTML & CSS]]></category>
		<category><![CDATA[IE]]></category>
		<category><![CDATA[png透明]]></category>

		<guid isPermaLink="false">http://www.iinterest.net/?p=585</guid>
		<description><![CDATA[IE6是个&#8221;神奇&#8221;的浏览器,其原因想必做前端的同行们都深有体会,:)作为我个人而言,最反感的就是IE6不支持除A以外的hover伪类,再一个就是它不支持png图片的alpha透明度.当然此类问题已有众多的解决方案,这里只是总结下自己常用的IE6下实现png半透明的方法以及适用环境. 1.使用滤镜,适用于单一png背景图片的快速部署;弊端:消耗资源比较多,方法比较繁琐. &#60;!DOCTYPE html&#62; &#60;html&#62; &#60;head&#62; &#60;meta http-equiv=&#34;Content-Type&#34; content=&#34;text/html; charset=utf-8&#34; /&#62; &#60;title&#62;ie6下png透明-iinterest&#60;/title&#62; &#60;style type=&#34;text/css&#34;&#62; *{margin:0; padding:0;} .box{ width:958px; height:512px; background:url(http://image215.poco.cn/mypoco/myphoto/20091114/16/51737245200911141635177073974043057_000.jpg) no-repeat; } .png-bg{width:341px; height:258px; margin:60px auto 0; background:url(http://www.iinterest.net/wp-content/uploads/2009/11/windows.png) no-repeat; _filter: progid:DXImageTransform.Microsoft.AlphaImageLoader(src='http://www.iinterest.net/wp-content/uploads/2009/11/windows.png'); _background-image:none; } &#60;/style&#62; &#60;/head&#62; &#60;body&#62; &#60;div class=&#34;box&#34;&#62; &#60;div class=&#34;png-bg&#34;&#62;&#60;/div&#62; &#8230; <a href="http://www.iinterest.net/2009/11/13/transparent-png-in-ie6/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p>IE6是个&#8221;神奇&#8221;的浏览器,其原因想必做前端的同行们都深有体会,:)作为我个人而言,最反感的就是IE6不支持除A以外的hover伪类,再一个就是它不支持png图片的alpha透明度.当然此类问题已有众多的解决方案,这里只是总结下自己常用的IE6下实现png半透明的方法以及适用环境.</p>
<p>1.使用滤镜,适用于单一png背景图片的快速部署;弊端:消耗资源比较多,方法比较繁琐.</p>
<div class="runcode">
<p><textarea name="runcode" class="runcode_text" id="runcode_Add6vb">
&lt;!DOCTYPE html&gt;
&lt;html&gt;
&lt;head&gt;
&lt;meta http-equiv=&quot;Content-Type&quot; content=&quot;text/html; charset=utf-8&quot; /&gt;
&lt;title&gt;ie6下png透明-iinterest&lt;/title&gt;
&lt;style type=&quot;text/css&quot;&gt;
*{margin:0; padding:0;}
.box{ width:958px; height:512px; background:url(http://image215.poco.cn/mypoco/myphoto/20091114/16/51737245200911141635177073974043057_000.jpg) no-repeat;  }
.png-bg{width:341px; height:258px; margin:60px auto 0; background:url(http://www.iinterest.net/wp-content/uploads/2009/11/windows.png) no-repeat; _filter: progid:DXImageTransform.Microsoft.AlphaImageLoader(src='http://www.iinterest.net/wp-content/uploads/2009/11/windows.png'); _background-image:none; }
&lt;/style&gt;
&lt;/head&gt;
&lt;body&gt;
&lt;div class=&quot;box&quot;&gt;
    &lt;div class=&quot;png-bg&quot;&gt;&lt;/div&gt;
&lt;/div&gt;
&lt;/body&gt;
&lt;/html&gt;
</textarea></p>
<p><input type="button" value="运行" class="runcode_button" onclick="runcode_open_new('runcode_Add6vb');"/> <input type="button" value="复制" class="runcode_button" onclick="runcode_copy('runcode_Add6vb');"/> 提示：你可以先修改部分代码再运行。</p>
</div>
<p>2.使用JS(pngfix.js),适用于插入png图片的部署;弊端:pngfix.js会影响到CSS的布局,如demo中img设置了margin,但在浏览时却无效,而且资源消耗较大.<br />
<span id="more-585"></span></p>
<div class="runcode">
<p><textarea name="runcode" class="runcode_text" id="runcode_zfAynC">
&lt;!DOCTYPE html&gt;
&lt;html&gt;
&lt;head&gt;
&lt;meta http-equiv=&quot;Content-Type&quot; content=&quot;text/html; charset=utf-8&quot; /&gt;
&lt;title&gt;ie6下png透明-iinterest&lt;/title&gt;
&lt;style type=&quot;text/css&quot;&gt;
*{margin:0; padding:0;}
.box{ width:958px; height:512px; background:url(http://image215.poco.cn/mypoco/myphoto/20091114/16/51737245200911141635177073974043057_000.jpg) no-repeat;}
	img{ margin:30px 0 0 100px; }
&lt;/style&gt;
&lt;script src=&quot;http://www.iinterest.net/demo/js/pngfix.js&quot; type=&quot;text/javascript&quot;&gt;&lt;/script&gt;
&lt;/head&gt;
&lt;body&gt;
&lt;div class=&quot;box&quot;&gt;
    &lt;img src=&quot;http://www.iinterest.net/wp-content/uploads/2009/11/windows.png&quot; alt=&quot;&quot;/&gt;
&lt;/div&gt;
&lt;/body&gt;
&lt;/html&gt;
</textarea></p>
<p><input type="button" value="运行" class="runcode_button" onclick="runcode_open_new('runcode_zfAynC');"/> <input type="button" value="复制" class="runcode_button" onclick="runcode_copy('runcode_zfAynC');"/> 提示：你可以先修改部分代码再运行。</p>
</div>
<p><a href="http://www.iinterest.net/demo/js/pngfix.js" target="_blank">dome中iepng.js下载</a></p>
<p>3.使用JS(iepng.js),背景图片和插入图片通杀,并可自定义需要png透明效果的容器,适用于复杂的布局环境;弊端:还是资源消耗问题&#8230;</p>
<div class="runcode">
<p><textarea name="runcode" class="runcode_text" id="runcode_J9OI8d">
&lt;!DOCTYPE html&gt;
&lt;html&gt;
&lt;head&gt;
&lt;meta http-equiv=&quot;Content-Type&quot; content=&quot;text/html; charset=utf-8&quot; /&gt;
&lt;title&gt;ie6下png透明-iinterest&lt;/title&gt;
&lt;style type=&quot;text/css&quot;&gt;
*{margin:0; padding:0;}
.box{ width:958px; height:512px; background:url(http://image215.poco.cn/mypoco/myphoto/20091114/16/51737245200911141635177073974043057_000.jpg) no-repeat;}
	img{ margin:-20px 0 0 10px; }
	.png-bg{width:341px; height:258px; margin:10px auto 0; background:url(http://www.iinterest.net/wp-content/uploads/2009/11/windows.png) no-repeat; text-align:center; line-height:258px;}
&lt;/style&gt;
&lt;script src=&quot;http://www.iinterest.net/demo/js/iepng.js&quot; type=&quot;text/javascript&quot;&gt;&lt;/script&gt;
&lt;script type=&quot;text/javascript&quot;&gt;
   GtPNG.fix('div, ul, img, li, input');  //GtPNG.fix 自定义包含透明PNG图片的标签,多个标签之间用英文逗号隔开。
&lt;/script&gt;
&lt;/head&gt;
&lt;body&gt;
&lt;div class=&quot;box&quot;&gt;
    &lt;div class=&quot;png-bg&quot;&gt;png-bg&lt;/div&gt;
    &lt;img src=&quot;http://www.iinterest.net/wp-content/uploads/2009/11/windows.png&quot; alt=&quot;&quot;/&gt;
&lt;/div&gt;
&lt;/body&gt;
&lt;/html&gt;
</textarea></p>
<p><input type="button" value="运行" class="runcode_button" onclick="runcode_open_new('runcode_J9OI8d');"/> <input type="button" value="复制" class="runcode_button" onclick="runcode_copy('runcode_J9OI8d');"/> 提示：你可以先修改部分代码再运行。</p>
</div>
<p><a href="http://www.iinterest.net/demo/js/iepng.js" target="_blank">demo中iepng.js下载</a></p>
]]></content:encoded>
			<wfw:commentRss>http://www.iinterest.net/2009/11/13/transparent-png-in-ie6/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
	</channel>
</rss>
