<?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>Klaus Hartl - Stilbüro &#187; CSS</title>
	<atom:link href="http://www.stilbuero.de/category/web-development/css/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.stilbuero.de</link>
	<description>We are reasonable people.</description>
	<lastBuildDate>Sat, 01 Nov 2008 19:08:11 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.8.6</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<item>
		<title>A quote from Dave Hyatt</title>
		<link>http://www.stilbuero.de/2008/05/07/a-quote-from-dave-hyatt/</link>
		<comments>http://www.stilbuero.de/2008/05/07/a-quote-from-dave-hyatt/#comments</comments>
		<pubDate>Wed, 07 May 2008 11:28:41 +0000</pubDate>
		<dc:creator>Klaus</dc:creator>
				<category><![CDATA[CSS]]></category>
		<category><![CDATA[Web Development]]></category>

		<guid isPermaLink="false">http://www.stilbuero.de/2008/05/07/a-quote-from-dave-hyatt/</guid>
		<description><![CDATA[
&#8220;The sad truth about CSS3 selectors is that they really shouldn’t be used at all if you care about page performance. Decorating your markup with classes and ids and matching purely on those while avoiding all uses of sibling, descendant and child selectors will actually make a page perform significantly better in all browsers.&#8221;

(http://www.shauninman.com/archive/2008/05&#8230;)
]]></description>
			<content:encoded><![CDATA[<blockquote cite="http://www.shauninman.com/archive/2008/05/05/css_qualified_selectors#comment_3942">
<p>&#8220;The sad truth about CSS3 selectors is that they really shouldn’t be used at all if you care about page performance. Decorating your markup with classes and ids and matching purely on those while avoiding all uses of sibling, descendant and child selectors will actually make a page perform significantly better in all browsers.&#8221;</p>
</blockquote>
<p>(<a href="http://www.shauninman.com/archive/2008/05/05/css_qualified_selectors#comment_3942">http://www.shauninman.com/archive/2008/05&#8230;</a>)</p>
]]></content:encoded>
			<wfw:commentRss>http://www.stilbuero.de/2008/05/07/a-quote-from-dave-hyatt/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Tabs Plugin: More flexibility</title>
		<link>http://www.stilbuero.de/2007/05/14/tabs-plugin-more-flexibility/</link>
		<comments>http://www.stilbuero.de/2007/05/14/tabs-plugin-more-flexibility/#comments</comments>
		<pubDate>Mon, 14 May 2007 09:34:33 +0000</pubDate>
		<dc:creator>Klaus</dc:creator>
				<category><![CDATA[CSS]]></category>
		<category><![CDATA[JavaScript]]></category>
		<category><![CDATA[Web Development]]></category>
		<category><![CDATA[jQuery]]></category>

		<guid isPermaLink="false">http://www.stilbuero.de/2007/05/14/tabs-plugin-more-flexibility/</guid>
		<description><![CDATA[Just a short note, I&#8217;ve updated the CSS for the Tabs plugin &#8211; because people did not stop asking &#8211; and tabs have a flexible width and height again. They still maintain a minimal width as well, so that tabs with short titles, as in the demo, will have the same width. Otherwise it would [...]]]></description>
			<content:encoded><![CDATA[<p>Just a short note, I&#8217;ve updated the CSS for the <a href="/jquery/tabs/#fragment-3">Tabs plugin</a> &#8211; because people did not stop asking &#8211; and tabs have a flexible width and height again. They still maintain a minimal width as well, so that tabs with short titles, as in the demo, will have the same width. Otherwise it would look a little cluttered (well, at least to me). I&#8217;m using a <a href="http://alistapart.com/articles/sprites">sprite technique</a> for the different parts of the tab of course, thus only one image needs to be downloaded.</p>
<p>Important to know is that this required <strong>an additional <code>span</code> element</strong> nested in the anchor element of a tab.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.stilbuero.de/2007/05/14/tabs-plugin-more-flexibility/feed/</wfw:commentRss>
		<slash:comments>81</slash:comments>
		</item>
		<item>
		<title>Dev.Opera</title>
		<link>http://www.stilbuero.de/2006/11/07/devopera/</link>
		<comments>http://www.stilbuero.de/2006/11/07/devopera/#comments</comments>
		<pubDate>Tue, 07 Nov 2006 05:40:07 +0000</pubDate>
		<dc:creator>Klaus</dc:creator>
				<category><![CDATA[CSS]]></category>
		<category><![CDATA[JavaScript]]></category>
		<category><![CDATA[Web Development]]></category>

		<guid isPermaLink="false">http://www.stilbuero.de/2006/11/07/devopera/</guid>
		<description><![CDATA[Via miscoded: Dev.Opera, a community resource site for developers is online. As one could expect from Opera there are already valuable articles online &#8211; for instance a very interesting one about Efficient JavaScript.
]]></description>
			<content:encoded><![CDATA[<p>Via <a href="http://my.opera.com/hallvors/blog/2006/11/06/welcome-dev-opera-com">miscoded</a>: Dev.Opera, a <q>community resource site</q> for developers <a href="http://dev.opera.com/">is online</a>. As one could expect from Opera there are already valuable articles online &#8211; for instance a very interesting one about <a href="http://dev.opera.com/articles/view/48/">Efficient JavaScript</a>.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.stilbuero.de/2006/11/07/devopera/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>A smoother Thickbox (with less code)</title>
		<link>http://www.stilbuero.de/2006/11/06/a-smoother-thickbox-with-less-code/</link>
		<comments>http://www.stilbuero.de/2006/11/06/a-smoother-thickbox-with-less-code/#comments</comments>
		<pubDate>Mon, 06 Nov 2006 00:44:52 +0000</pubDate>
		<dc:creator>Klaus</dc:creator>
				<category><![CDATA[CSS]]></category>
		<category><![CDATA[JavaScript]]></category>
		<category><![CDATA[Web Development]]></category>
		<category><![CDATA[jQuery]]></category>

		<guid isPermaLink="false">http://www.stilbuero.de/2006/11/06/a-smoother-thickbox-with-less-code/</guid>
		<description><![CDATA[Here's an instruction on how to make the beautiful <a href="http://jquery.com/demo/thickbox/">Thickbox</a> even better. These things came to my mind while I was implementing Thickbox for <a href="http://plazes.com">Plazes</a>. The result is a much smoother Thickbox with much less JavaScript code. ]]></description>
			<content:encoded><![CDATA[<p>Here&#8217;s an instruction on how to make the beautiful <a href="http://jquery.com/demo/thickbox/">Thickbox</a> even better. These things came to my mind while I was implementing Thickbox for <a href="http://plazes.com">Plazes</a>. The result is a much smoother Thickbox with much less JavaScript code. </p>
<p>What bothered me was that when scrolling or resizing the browser window the Thickbox modal window gets moved to stay in the center, but that happens not smooth at all and with a little delay (after the resize/scroll events get fired that is).</p>
<p>So I changed the Thickbox <abbr title="Cascading Style Sheets">CSS</abbr> to use fixed positioning, starting with the modal window:</p>
<ol>
<li>
<p>Change <abbr>CSS</abbr> to this:</p>
<pre><code>html, body {
    height: 100%;
}

#TB_window {
    position: fixed;
    top: 50%;
    left: 50%;
    ...
}</code></pre>
</li>
<li>
<p>Remove the scroll and resize event handler:</p>
<pre><code>$(window).scroll(TB_position);
$(window).resize(TB_position);</code></pre>
</li>
<li>
<p>Change the function <code>TB_position</code> to this:</p>
<pre><code>function TB_position() {
     $("#TB_window").css({marginLeft: '-' + parseInt(TB_WIDTH / 2) + 'px', width: TB_WIDTH + 'px'});
     if ( !(jQuery.browser.msie &#038;&#038; typeof XMLHttpRequest == 'function') ) { // take away IE6
         $("#TB_window").css({marginTop: '-' + parseInt(TB_HEIGHT / 2) + 'px'});
     }
     TB_overlaySize();
}</code></pre>
<p>It now pushes the modal window half of its width/height to the left/top from the middle so that it is exactly centered.</p>
</li>
<li>
<p>Fix our special friend <abbr title="Internet Explorer">IE</abbr> 6 to emulate a fixed positioning:</p>
<pre><code>* html #TB_window {
     position: absolute;
     margin-top: expression(0 - parseInt(this.offsetHeight / 2) + (TBWindowMargin = document.documentElement &#038;&#038; document.documentElement.scrollTop || document.body.scrollTop) + 'px');
}</code></pre>
<p>(Based on <a href="http://www.howtocreate.co.uk/fixedPosition.html">http://www.howtocreate.co.uk/fixedPosition.html</a>)</p>
<p>I use the Star Selector hack to hide these styles from <abbr>IE</abbr> 7, which supports fixed<br />
positioning. Because this being invalid <abbr>CSS</abbr>, I recommend inclusion in an extra style sheet via <a href="http://msdn.microsoft.com/workshop/author/dhtml/overview/ccomment_ovw.asp">Conditional Comments</a>.</p>
</li>
<li><em>Smoooooth.</em></li>
<li>
<p>The same consideration applies to the overlay and the spinner. There is still some overhead to compute their dimensions and position depending on the state of the viewport.</p>
<p>Use fixed positioning here as well and make the overlay 100% wide and high:</p>
<pre><code>#TB_overlay {
     position: fixed;
     top: 0;
     left: 0;
     width: 100%;
     height: 100%;
     ...
}

#TB_load {
    position: fixed;
    top: 50%;
    left: 50%;
    margin: -50px 0 0 -50px; /* -height/2 0 0 -width/2 */
    ...
}</code></pre>
</li>
<li>
<p>Change <code>TB_load_position();</code> to <code>$('#TB_load').show();</code> and throw away</p>
<pre><code>function TB_overlaySize(){
    ...
}</code></pre>
<p>and all references to it. Also remove</p>
<pre><code>function TB_load_position() {
    ...
}

function TB_getPageScrollTop(){
    ...
}</code></pre>
<p>Nearly done!</p>
</li>
<li>
<p>The only thing we still need to do is to accommodate <abbr>IE</abbr> 6 with a <a href="http://msdn.microsoft.com/workshop/author/dhtml/overview/recalc.asp">Dynamic Property</a> again:</p>
<pre><code>* html #TB_overlay {
     position: absolute;
     height: expression(document.body.scrollHeight &gt; document.body.offsetHeight ? document.body.scrollHeight : document.body.offsetHeight + 'px');
}</code></pre>
<p>And don&#8217;t forget to add <code>* html #TB_load</code>:</p>
<pre><code>* html #TB_window, * html #TB_load {
    ...
}</code></pre>
</li>
</ol>
<p><a href="/demo/thickbox/">Here&#8217;s a demo with all these modifications to the original.</a> Try scrolling and resizing the window and you will see the difference. I&#8217;d really like to see that in a future version of Thickbox. Have fun!</p>
]]></content:encoded>
			<wfw:commentRss>http://www.stilbuero.de/2006/11/06/a-smoother-thickbox-with-less-code/feed/</wfw:commentRss>
		<slash:comments>37</slash:comments>
		</item>
		<item>
		<title>As time goes by</title>
		<link>http://www.stilbuero.de/2006/10/17/as-time-goes-by/</link>
		<comments>http://www.stilbuero.de/2006/10/17/as-time-goes-by/#comments</comments>
		<pubDate>Tue, 17 Oct 2006 06:46:53 +0000</pubDate>
		<dc:creator>Klaus</dc:creator>
				<category><![CDATA[CSS]]></category>
		<category><![CDATA[Notebook]]></category>
		<category><![CDATA[Web Development]]></category>

		<guid isPermaLink="false">http://www.stilbuero.de/2006/10/17/as-time-goes-by/</guid>
		<description><![CDATA[Wow, Shaun Inman comes up with a truly innovative idea for his blog: Things are &#8220;aging&#8221; over the time and this is communicated visually. 33306 single style sheets were required, one for each day of the year.
I&#8217;m impressed!
]]></description>
			<content:encoded><![CDATA[<p>Wow, <a href="http://www.shauninman.com/post/heap/2006/10/16/the_9th_incarnation_of_shauninman_com">Shaun Inman</a> comes up with a truly innovative idea for his blog: Things are &#8220;aging&#8221; over the time and this is communicated visually. 33306 single style sheets were required, one for each day of the year.</p>
<p>I&#8217;m impressed!</p>
]]></content:encoded>
			<wfw:commentRss>http://www.stilbuero.de/2006/10/17/as-time-goes-by/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Flicker Fixed</title>
		<link>http://www.stilbuero.de/2006/09/27/flicker-fixed/</link>
		<comments>http://www.stilbuero.de/2006/09/27/flicker-fixed/#comments</comments>
		<pubDate>Wed, 27 Sep 2006 07:18:25 +0000</pubDate>
		<dc:creator>Klaus</dc:creator>
				<category><![CDATA[CSS]]></category>
		<category><![CDATA[JavaScript]]></category>
		<category><![CDATA[Web Development]]></category>

		<guid isPermaLink="false">http://www.stilbuero.de/2006/09/27/flicker-fixed/</guid>
		<description><![CDATA[Dan Popa found an interesting fix for the ever annoying flickering CSS background images in IE.
There is also a fix that involves configuring your server, which I prefer, because the new solution relies on JavaScript.
Still it&#8217;s an amazing discovery and it&#8217;s very useful in cases you don&#8217;t have access to the server configuration. I really [...]]]></description>
			<content:encoded><![CDATA[<p><a href="http://misterpixel.blogspot.com/2006/08/title-well-its-done-my-ie6-background.html">Dan</a> <a href="http://misterpixel.blogspot.com/2006/09/forensic-analysis-of-ie6.html">Popa</a> found an interesting fix for the ever annoying flickering <abbr title="Cascading Style Sheets">CSS</abbr> background images in <abbr title="Internet Explorer">IE</abbr>.</p>
<p>There is also a <a href="http://dean.edwards.name/my/flicker.html">fix</a> that involves configuring your server, which I prefer, because the new solution relies on JavaScript.</p>
<p>Still it&#8217;s an amazing discovery and it&#8217;s very useful in cases you don&#8217;t have access to the server configuration. I really wonder why Microsoft kept that a secret for such a long time. Maybe there are some yet unknown side effects.</p>
<p>Via <a href="http://ajaxian.com/archives/no-more-ie6-background-flicker">Ajaxian</a>.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.stilbuero.de/2006/09/27/flicker-fixed/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>IE&#8217;s universal selector is really universal</title>
		<link>http://www.stilbuero.de/2006/09/17/ies-universal-selector-is-really-universal/</link>
		<comments>http://www.stilbuero.de/2006/09/17/ies-universal-selector-is-really-universal/#comments</comments>
		<pubDate>Sun, 17 Sep 2006 17:34:04 +0000</pubDate>
		<dc:creator>Klaus</dc:creator>
				<category><![CDATA[CSS]]></category>
		<category><![CDATA[Web Development]]></category>

		<guid isPermaLink="false">http://www.stilbuero.de/2006/09/17/ies-universal-selector-is-really-universal/</guid>
		<description><![CDATA[As it turned out, the universal selector is a little too universal in IE 7 (RC 1).
Some simple CSS like
body * {
    display: block;
    border: 1px solid;
    padding: .25em .5em;
    background: #808080;
}
with such HTML
&#60;body&#62;
    &#60;p&#62;
      [...]]]></description>
			<content:encoded><![CDATA[<p>As it <a href="http://nanobox.chipx86.com/blog/2006/04/easy-css-hacks-for-ie7.php">turned</a> <a href="http://nanobox.chipx86.com/blog/2006/07/before-and-after-in-ie7-and-below.php">out</a>, the universal selector is a little too universal in <abbr title="Internet Explorer">IE</abbr> 7 (<abbr title="Release Candidate">RC</abbr> 1).</p>
<p>Some simple <abbr title="Cascading Style Sheet">CSS</abbr> like</p>
<pre><code class="css">body * {
    display: block;
    border: 1px solid;
    padding: .25em .5em;
    background: #808080;
}</code></pre>
<p>with such <abbr title="HyperText Markup Language">HTML</abbr></p>
<pre><code class="html">&lt;body&gt;
    &lt;p&gt;
        ...
    &lt;/p&gt;
    &lt;!-- An HTML coment --&gt;
    &lt;p&gt;
        ...
    &lt;/p&gt;
&lt;/body&gt;</code></pre>
<p>results in 3 Boxes in <abbr>IE</abbr> 7.</p>
<p><a href="http://stilbuero.de/demo/ie7_universal_selector_bug/">Here&#8217;s my own test.</a></p>
<p>This opens the door for some <a href="http://nanobox.chipx86.com/blog/2006/04/easy-css-hacks-for-ie7.php">new hacks</a> and even an <a href="http://nanobox.chipx86.com/blog/2006/07/before-and-after-in-ie7-and-below.php">amazing technique</a> to make the <code>:before</code> and <code>:after</code> pseudo-elements possible to some extend.</p>
<p>This technique would also make for a good clearing floats without presentational markup, as long as the <code>clear</code> property is applied (not tested).</p>
<p>Apart from that, this is not a minor issue. With such a parser bug <strong>the universal selector becomes useless</strong> or we the web developers are doomed to never use <abbr>HTML</abbr> comments again to be able to rely on this selector. I cannot believe that this &#8220;feature&#8221; will make it into the final release.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.stilbuero.de/2006/09/17/ies-universal-selector-is-really-universal/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
		<item>
		<title>Dude, where&#8217;s my WordPress theme?</title>
		<link>http://www.stilbuero.de/2006/04/15/dude-wheres-my-wordpress-theme/</link>
		<comments>http://www.stilbuero.de/2006/04/15/dude-wheres-my-wordpress-theme/#comments</comments>
		<pubDate>Sat, 15 Apr 2006 12:49:31 +0000</pubDate>
		<dc:creator>Klaus</dc:creator>
				<category><![CDATA[CSS]]></category>
		<category><![CDATA[JavaScript]]></category>
		<category><![CDATA[Web Development]]></category>

		<guid isPermaLink="false">http://www.stilbuero.de/2006/04/15/dude-wheres-my-wordpress-theme/</guid>
		<description><![CDATA[Here it is. Finally I found the time to build my own WordPress theme. The theme sports  clean, accessible XHTML delivered as XHTML 1.1 and application/xhtml+xml (as recommended by the W3C) to capaple browsers (EOMB) &#8211; because I can do it &#8211; and degrades to XHTML 1.0 compliant to the HTML Compatibility Guidelines in [...]]]></description>
			<content:encoded><![CDATA[<p>Here it is. Finally I found the time to build my own WordPress theme. The theme sports  clean, accessible XHTML delivered as XHTML 1.1 and <code>application/xhtml+xml</code> <ins datetime="2006-04-24T21:07:07+00:00">(<a href="http://www.w3.org/TR/xhtml-media-types/#summary">as recommended by the W3C</a>)</ins> to capaple browsers (<abbr title="Every Other Modern Browser">EOMB</abbr>) &#8211; because I can do it &#8211; and degrades to XHTML 1.0 compliant to the <a href="http://www.w3.org/TR/xhtml1/guidelines.html">HTML Compatibility Guidelines</a> in <span title="Internet Explorer?">other ones</span>. The layout is fluid-elastic, with min- and max-width (even in <abbr title="Internet Explorer">IE</abbr>).</p>
<p>What&#8217;s next:</p>
<ul>
<li><del datetime="2006-04-23T22:50:00+00:00">I need to put in some Icons here and there. <a href="http://chameleon.simplebits.com/">Maybe these?</a></del><ins datetime="2006-04-23T22:50:00+00:00"> Done. Apparently.</ins></li>
<li><del datetime="2006-04-17T18:54:22+00:00">I will add style sheets for print and handheld.</del><ins datetime="2006-04-17T18:54:22+00:00">Done. Also available as alternate style sheets.</ins></li>
<li>I want to ajaxify the comments. I believe there are some plugins already, but I want to build my own of course (with <a href="http://jquery.com/">jQuery</a>).</li>
</ul>
<p>Have fun!</p>
<div><ins datetime="2006-04-16T21:29:44+00:00"><strong>Update:</strong> Added my <a href="http://microformats.org/wiki/hcard">hCard</a> to the <a href="http://www.stilbuero.de/contact/">contact page</a>.</ins></div>
]]></content:encoded>
			<wfw:commentRss>http://www.stilbuero.de/2006/04/15/dude-wheres-my-wordpress-theme/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>PNG alpha transparency, fast and easy</title>
		<link>http://www.stilbuero.de/2006/03/15/png-alpha-transparency-fast-and-easy/</link>
		<comments>http://www.stilbuero.de/2006/03/15/png-alpha-transparency-fast-and-easy/#comments</comments>
		<pubDate>Wed, 15 Mar 2006 22:48:24 +0000</pubDate>
		<dc:creator>Klaus</dc:creator>
				<category><![CDATA[CSS]]></category>
		<category><![CDATA[Web Development]]></category>

		<guid isPermaLink="false">http://www.stilbuero.de/?p=44</guid>
		<description><![CDATA[Here's another "fast and easy" installment: I wondered today, how to add PNG alpha transparency support to Internet Explorer the easiest way possible, without longish scripts and instead easily maintainable in a style sheet . This is not meant to spoil anyone's <a href="http://webfx.eae.net/dhtml/pngbehavior/pngbehavior.html">good</a> <a href="http://www.alistapart.com/articles/pngopacity/">work</a> and as you can see, the basic technique wasn't discovered by me. It's just an alternate and hopefully easier way to do it.]]></description>
			<content:encoded><![CDATA[<p>Here&#8217;s another &#8220;fast and easy&#8221; installment: I wondered today, how to add PNG alpha transparency support to Internet Explorer the easiest way possible, without longish scripts and instead easily maintainable in a style sheet . This is not meant to spoil anyone&#8217;s <a href="http://webfx.eae.net/dhtml/pngbehavior/pngbehavior.html">good</a> <a href="http://www.alistapart.com/articles/pngopacity/">work</a> and as you can see, the basic technique wasn&#8217;t discovered by me. It&#8217;s just an alternate and hopefully easier way to do it.</p>
<p>An accordingly transparent PNG image, a transparent GIF image (Ugh, I thought I&#8217;d never had to use these again&#8230;) and the following snippet is all you need.</p>
<p><abbr title="Every Other Modern Browser">EOMB</abbr> will render your beautiful PNG with the following, very simple <abbr title="HyperText Markup Language">HTML</abbr>:</p>
<pre><code>&lt;img class=&quot;png&quot; src=&quot;/path/to/your.png&quot; alt=&quot;different story&quot; /&gt;</code></pre>
<p><abbr title="Internet Explorer">IE</abbr> needs to get some special treatment:</p>
<pre><code class="css">img.png {
    background-image: expression(
        this.runtimeStyle.backgroundImage = "none",
        this.runtimeStyle.filter = "progid:DXImageTransform.Microsoft.AlphaImageLoader(src='" + this.src + "', sizingMethod='image')",
        this.src = "/path/to/transparent.gif"
    );
}</code></pre>
<p>Though I said I wanted to avoid longish scripts, JavaScript (in disguise of <a href="http://msdn.microsoft.com/workshop/author/dhtml/overview/recalc.asp">Dynamic Properties</a>) is still necessary.</p>
<p><code class="javascript">this.runtimeStyle.filter = ...</code>  is to apply the appropriate filter for loading and rendering your PNG correctly. Note that the path to the PNG is read from the <code class="html">img</code> element&#8217;s <code class="html">src</code> attribute via <code class="javascript">this.src</code>, so that when you have to change the path you do it once <em>and only once</em> in your HTML  source and can leave the rest as supplied before. That&#8217;s why I used an expression for this at all and not simply the <code class="css">filter</code> property.</p>
<p>The next expression replaces the PNG with the transparent GIF image so that the same PNG displayed by the <a href="http://msdn.microsoft.com/workshop/author/filter/reference/filters/alphaimageloader.asp">AlphaImageLoader filter</a> one level below shows up. This has to be done <em>after</em> we have passed the value of the <code class="html">src</code> attribute to the filter.</p>
<p>Do not omit the first expression, although it seems useless! You would throw <abbr>IE</abbr> into an infinite loop loading the GIF over and over again. Don&#8217;t ask why, please&#8230; Even though I don&#8217;t like <abbr>IE</abbr> I don&#8217;t want to make it hang.</p>
<p><strong>Important: </strong><a href="http://blogs.msdn.com/ie/archive/2005/07/29/445242.aspx"><abbr>IE</abbr> 7 has native PNG alpha transparency support</a>. You should use <a href="http://msdn.microsoft.com/workshop/author/dhtml/overview/ccomment_ovw.asp">Conditional Comments</a> to include the above style sheet in one or the other way (besides that your style sheet wouldn&#8217;t validate):</p>
<pre><code>&lt;!--[if lte IE 6]&gt;
...
&lt;![endif]--&gt;</code></pre>
<p><strong>Some final notes:</strong></p>
<ul>
<li>Of course you don&#8217;t have to rely on the class name &quot;png&quot;. It&#8217;s just an example. You can use whatever selector <del datetime="2006-03-15T20:56:15+00:00">you want</del><ins datetime="2006-03-15T20:56:15+00:00"><abbr>IE</abbr> lets you use</ins>.</li>
<li>If there is no JavaScript, <abbr>IE</abbr> simply renders your PNG image without alpha transparency.</li>
<li>If JavaScript is turned on, but ActiveX not, you&#8217;ll get nothing.</li>
<li>The AlphaImageLoader filter is supported in <abbr>IE</abbr> 5.5+/<abbr>Win</abbr>.</li>
<li><a href="/demo/png_alpha_transparency/">A little demo is here.</a></li>
</ul>
]]></content:encoded>
			<wfw:commentRss>http://www.stilbuero.de/2006/03/15/png-alpha-transparency-fast-and-easy/feed/</wfw:commentRss>
		<slash:comments>24</slash:comments>
		</item>
		<item>
		<title>Acid2 test</title>
		<link>http://www.stilbuero.de/2006/03/15/acid2-test/</link>
		<comments>http://www.stilbuero.de/2006/03/15/acid2-test/#comments</comments>
		<pubDate>Wed, 15 Mar 2006 00:31:06 +0000</pubDate>
		<dc:creator>Klaus</dc:creator>
				<category><![CDATA[CSS]]></category>
		<category><![CDATA[Web Development]]></category>

		<guid isPermaLink="false">http://www.stilbuero.de/2006/03/15/acid2-test/</guid>
		<description><![CDATA[

Acid2 test, originally uploaded by carhartl.


	One good browser (for web standardistas at least). Test yours.
]]></description>
			<content:encoded><![CDATA[<dl class="flickr">
<dt><a href="http://www.flickr.com/photos/carhartl/112642614/" title="photo sharing"><img src="http://static.flickr.com/53/112642614_14840419cb.jpg" alt="Acid2 test" /></a></dt>
<dd><a href="http://www.flickr.com/photos/carhartl/112642614/">Acid2 test</a>, originally uploaded by <a href="http://www.flickr.com/people/carhartl/">carhartl</a>.</dd>
</dl>
<p>
	One good browser (for web standardistas at least). <a href="http://archive2.webstandards.org/act/acid2/test.html">Test yours.</a></p>
]]></content:encoded>
			<wfw:commentRss>http://www.stilbuero.de/2006/03/15/acid2-test/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
