<?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>Takin&#039; a Bathew &#187; png</title>
	<atom:link href="http://bathew.com/tag/png/feed/" rel="self" type="application/rss+xml" />
	<link>http://bathew.com</link>
	<description></description>
	<lastBuildDate></lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3.2</generator>
		<item>
		<title>Transparent background PNG&#8217;s in IE: The only guide you need</title>
		<link>http://bathew.com/playhouse/transparent-background-pngs-in-ie-the-only-guide-you-need/</link>
		<comments>http://bathew.com/playhouse/transparent-background-pngs-in-ie-the-only-guide-you-need/#comments</comments>
		<pubDate>Fri, 09 Jan 2009 16:19:41 +0000</pubDate>
		<dc:creator>mbathon</dc:creator>
				<category><![CDATA[Playhouse]]></category>
		<category><![CDATA[background-image]]></category>
		<category><![CDATA[css]]></category>
		<category><![CDATA[ie]]></category>
		<category><![CDATA[ie6]]></category>
		<category><![CDATA[internet explorer]]></category>
		<category><![CDATA[png]]></category>
		<category><![CDATA[transparency]]></category>

		<guid isPermaLink="false">http://bathew.com/?p=36</guid>
		<description><![CDATA[I know this question has been around for a very long time but I am still seeing bookmarks and stories pop up around the web for ways of handling transparent PNG's in Internet Explorer (IE) 6 and below. After working with them for a long time now, I thought that I would post the best [...]]]></description>
			<content:encoded><![CDATA[<p>I know this question has been around for a very long time but I am still seeing bookmarks and stories pop up around the web for ways of handling transparent <abbr title="Portable Network Graphics">PNG</abbr>'s in Internet Explorer (<abbr title="Internet Explorer">IE</abbr>) 6 and below. After working with them for a long time now, I thought that I would post the best way that I have found to achieve transparent background images. This method is nothing new. It may be used in conjunction with a new way but the <abbr title="Cascading Style Sheets">CSS</abbr> has been around for a very long time. I wanted to focus on the background image. I see a lot more ways of dealing with an actual image in the page and not so much the background image.<span id="more-36"></span></p>
<p>I hope this will serve as a reference for people to get all of the the info they need in one place and not have to visit two or three sites. Without further adieu let us begin.</p>
<p>I want to start off by saying that I think retrofitting for older browsers (yes <abbr title="Internet Explorer">IE</abbr> 6 and below are too old) is a bad idea. We should be moving forward with our development in <abbr title="Cascading Style Sheets">CSS</abbr>3 etc... while making sure the older browser are still readable. They do not necessarily need to look the same. Now, with that said, I work as a web developer and know that this idea is rarely accepted by designers and clients alike. I just wanted to get my feelings out there because that is the whole point of this blog. On to the method already.</p>
<p>Wait for it...</p>
<h3>The <abbr title="Cascading Style Sheets">CSS</abbr></h3> 
<pre class="brush: css; title: ; notranslate">
* html #id {background-image: none; filter:progid:DXImageTransform.Microsoft.AlphaImageLoader(src='images/image_name.png',sizingMethod='scale');}
</pre>
<p>yep! That's all it is. No fancy javascript, no special image name with transparency behind it, nothing. Throw that in your <abbr title="Internet Explorer">IE</abbr> style sheet or right below your 'good browser' statement in your screen style sheet and you will be good to go. Remember: the path is relative to the page you are on, not the <abbr title="Cascading Style Sheets">CSS</abbr> file. So absolute path to the image is probably the best way to go.</p>
<h3>Notes</h3>
<p>As always there are some things to be aware of when using the filter method. If you make sure to follow this rule, you will save yourself a lot of headache. On the element your are using the filter. DO NOT set a position. On any element inside of the element with the filter, DO set position to relative.</p>
<p>(eg.) If your transparency is on your wrap div, do not set a position. Set position relative on your <code>content</code> div and all items within content will be OK.</p>
<p>Now your links and text will be clickable and selectable.</p>
<pre class="brush: xml; title: ; notranslate">
&lt;div id=&quot;wrap&quot;&gt;
&lt;div id=&quot;content&quot;&gt;
&lt;h1&gt;Site Title&lt;/h1&gt;
&lt;h2&gt;Tagline&lt;/h2&gt;
&lt;p&gt;Some &lt;a&gt;long-winded&lt;/a&gt; content with a link&lt;/p&gt;
&lt;/div&gt;&lt;!--end #content--&gt;
&lt;/div&gt;&lt;!--end #wrap--&gt;
</pre>
<pre class="brush: css; title: ; notranslate">
#wrap {background: url(../images/image_name.png);}
* html #wrap {background-image: none; filter:progid:DXImageTransform.Microsoft.AlphaImageLoader(src='images/image_name.png',sizingMethod='scale');}
#content {postion: relative;}
</pre>
<p>As with all other posts you have read about the filter method. The background image will stretch to fit the element, so there is no background-position usage <abbr title="Et Cetera">etc</abbr>...</p> <p>If you are unable to use a separate (slightly modified) design to handle your transparency needs for <abbr title="Internet Explorer">IE</abbr> then the above method will save you a lot of pain when dealing with them.</p>
<p>Below is the code for a snippet to add the above <abbr title="Cascading Style Sheet">CSS</abbr> to your style sheet easily with <a href="http://macromates.com/">Textmate</a> or <a href="http://en.wikipedia.org/wiki/E_(text_editor)">e text editor</a></p>
<p>create a new snippet<br /> add:</p>
<pre class="brush: css; title: ; notranslate">
background-image: none; filter:progid:DXImageTransform.Microsoft.AlphaImageLoader(src='images/${1:image_name}.png',sizingMethod='scale');$0
</pre>
<p>to the big block<br /> Activation: tab trigger > iepng<br /> Scope Selector: source.css</p>
<h3>Further Reading</h3>
<ul>
<li><a href="http://www.hrunting.org/csstests/iealpha.html">http://www.hrunting.org/csstests/iealpha.html</a></li>
</ul> <img src="http://bathew.com/writings/wp-content/plugins/wordpress-feed-statistics/feed-statistics.php?view=1&post_id=36" width="1" height="1" style="display: none;" />]]></content:encoded>
			<wfw:commentRss>http://bathew.com/playhouse/transparent-background-pngs-in-ie-the-only-guide-you-need/feed/</wfw:commentRss>
		<slash:comments>8</slash:comments>
		</item>
	</channel>
</rss>

