<?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>mandagreen.com &#187; CSS</title>
	<atom:link href="http://mandagreen.com/category/css/feed/" rel="self" type="application/rss+xml" />
	<link>http://mandagreen.com</link>
	<description>Refresh your vision</description>
	<lastBuildDate>Wed, 30 Nov 2011 15:22:56 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3.1</generator>
		<item>
		<title>Fixing PNG CSS backgrounds on IE6</title>
		<link>http://mandagreen.com/fixing-png-css-backgrounds-on-ie6/</link>
		<comments>http://mandagreen.com/fixing-png-css-backgrounds-on-ie6/#comments</comments>
		<pubDate>Thu, 17 Dec 2009 11:22:28 +0000</pubDate>
		<dc:creator>Cristi</dc:creator>
				<category><![CDATA[CSS]]></category>
		<category><![CDATA[ie6]]></category>
		<category><![CDATA[png]]></category>
		<category><![CDATA[sprites]]></category>

		<guid isPermaLink="false">http://mandagreen.com/?p=110</guid>
		<description><![CDATA[Today I was stuck (again) on a really annoying IE6 glitch. In the photo, screenshot #1 is the correct display in IE6 after the fix (and all other &#8220;sane&#8221; browsers before the fix), while screenshot #2 shows the glitch. Basically, IE6 decided to replicate the beginning of the same image on all items. You might [...]]]></description>
			<content:encoded><![CDATA[<div class="addthis_toolbox addthis_default_style" addthis:url='http://mandagreen.com/fixing-png-css-backgrounds-on-ie6/' addthis:title='Fixing PNG CSS backgrounds on IE6' ><a class="addthis_button_tweet"></a><a class="addthis_button_facebook_like"></a><a class="addthis_button_google_plusone"></a></div><p><a href="http://mandagreen.com/download/ie6-png-problems.jpg" class="thickbox"><img class="alignright size-full wp-image-111" title="IE6 PNG CSS background problems" src="http://mandagreen.com/download/ie6-png-problems.jpg" alt="ie6-png-problems" width="300" /></a><br />
Today I was stuck (again) on a really annoying IE6 glitch. In the photo, screenshot #1 is the correct display in IE6 after the fix (and all other &#8220;sane&#8221; browsers before the fix), while screenshot #2 shows the glitch. Basically, IE6 decided to replicate the beginning of the same image on all items.</p>
<p>You might think the problem was in my HTML code, or maybe in my CSS code. The HTML is 100% valid and following all modern guidelines: only a&#8217;s, li&#8217;s, div&#8217;s and text nodes. So, the problem could be in the CSS file &#8211; which applied a single sprite sheet on all the li&#8217;s, div&#8217;s and a&#8217;s, through <code>background-position</code>. In case you&#8217;re wondering what css sprites are, have a quick look: <a href="http://www.google.com/search?q=css+sprites&#038;hl=en" target="_blank">http://www.google.com/search?q=css+sprites&#038;hl=en</a></p>
<p>So, after adding <code>zoom</code>, <code>z-index</code>, removing <code>position: relative;</code>, removing overriding classes, changing all <code>background</code> declarations to <code>background-image, background-repeat, background-position</code> declarations, the problem persisted. In other words, none of the regular methods worked. </p>
<p>After a quick-search on the internet, I found some articles discussing PNG overlaps and transparency on IE6, but also mentioning <code>background-position</code>&#8216;s (<a href="http://www.dillerdesign.com/experiment/DD_belatedPNG/" target="_blank">http://www.dillerdesign.com/experiment/DD_belatedPNG/</a>, <a href="http://www.hotscripts.com/forums/css/45733-solved-css-newb-overlap-issue-ie6-2-links-issue.html" target="_blank">http://www.hotscripts.com/forums/css/45733-solved-css-newb-overlap-issue-ie6-2-links-issue.html</a>). Just then I realized that the problem might be with the file format &#8211; stupid, in my opinion, but not in IE6&#8242;s opinion. </p>
<p>Changing the file from a regular 8-bit PNG to a GIF <strong>solved</strong> the entire overlapping problem. No CSS intervention (other than changing the reference to a .gif file), no HTML edits, just an image format change. </p>
<p>&nbsp;</p>
<h2>Conclusion</h2>
<p>If you don&#8217;t need images with an alpha channel and want to use <code>background-position</code>&#8216;s with those images, and want to make it work with IE6, <strong>stick to GIF files</strong>. If you don&#8217;t care about IE6, then this will definitely not be not a problem for you.</p>
<p>&nbsp;</p>
<div class="addthis_toolbox addthis_default_style addthis_32x32_style" addthis:url='http://mandagreen.com/fixing-png-css-backgrounds-on-ie6/' addthis:title='Fixing PNG CSS backgrounds on IE6 ' ><a class="addthis_button_preferred_1"></a><a class="addthis_button_preferred_2"></a><a class="addthis_button_preferred_3"></a><a class="addthis_button_preferred_4"></a><a class="addthis_button_compact"></a></div>]]></content:encoded>
			<wfw:commentRss>http://mandagreen.com/fixing-png-css-backgrounds-on-ie6/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

