<?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>Komodo Media &#187; CSS</title>
	<atom:link href="http://www.komodomedia.com/categories/css/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.komodomedia.com</link>
	<description>blog, webdesign, illustration &#38; newsk00l javascript</description>
	<lastBuildDate>Wed, 18 Jan 2012 14:43:34 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.9.2</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<item>
		<title>Fine Goods Market</title>
		<link>http://www.komodomedia.com/blog/2012/01/fine-goods-market-2/</link>
		<comments>http://www.komodomedia.com/blog/2012/01/fine-goods-market-2/#comments</comments>
		<pubDate>Fri, 13 Jan 2012 15:36:09 +0000</pubDate>
		<dc:creator>Rogie</dc:creator>
				<category><![CDATA[CSS]]></category>
		<category><![CDATA[Fine Goods]]></category>
		<category><![CDATA[Portfolio]]></category>
		<category><![CDATA[clothing]]></category>
		<category><![CDATA[design]]></category>

		<guid isPermaLink="false">http://www.komodomedia.com/?p=2994</guid>
		<description><![CDATA[
It&#8217;s been about a year coming. I&#8217;m glad to finally announce that my personal goods marketplace, Fine Goods Market, is here! Not only is is sporting icons, overlays and scripts, but to make Fine Goods a thing truly special, it&#8217;s sporting some goods to wear — that&#8217;s right, it&#8217;s sporting premium tee shirts. Be expecting many [...]]]></description>
			<content:encoded><![CDATA[<p><a href="http://finegoodsmarket.com"><img src="http://d2dnrmagaqciul.cloudfront.net/wp-content/uploads/2012/01/finegoods.png" alt="" title="viewjs" class="aligncenter size-full wp-image-2978" /></a></p>
<p>It&#8217;s been about a year coming. I&#8217;m glad to finally announce that my personal goods marketplace, Fine Goods Market, is here! Not only is is sporting icons, overlays and scripts, but to make <a href="http://finegoodsmarket.com">Fine Goods</a> a thing truly special, it&#8217;s sporting some goods to wear — that&#8217;s right, it&#8217;s <a href="http://www.finegoodsmarket.com/category/clothes">sporting premium tee shirts</a>. Be expecting many more icon sets and digital resources to come! Also, pick up the new <a href="http://www.finegoodsmarket.com/product/basic-social-media-icons">Basic Social Media free icons here</a>.</p>
<p>I&#8217;m sure I&#8217;ll have more to share about the process of making <a href="http://finegoodsmarket.com">Fine Goods</a>, but the proof should be in the pudding, as the store has a few schnazzy design tricks up it&#8217;s sleeves, including CSS3 animations, custom scrollbars and more! </p>
<p><a href="http://finegoodsmarket.com">Check it out</a> and let me know what you think. Thanks for all the support in getting this project live, fellow interwebbians.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.komodomedia.com/blog/2012/01/fine-goods-market-2/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>View.js — A Simple, Lightweight, jQuery Photo Viewer</title>
		<link>http://www.komodomedia.com/blog/2011/11/view-js-%e2%80%94%c2%a0a-simple-lightweight-jquery-photo-viewer-for-the-web/</link>
		<comments>http://www.komodomedia.com/blog/2011/11/view-js-%e2%80%94%c2%a0a-simple-lightweight-jquery-photo-viewer-for-the-web/#comments</comments>
		<pubDate>Thu, 17 Nov 2011 14:36:09 +0000</pubDate>
		<dc:creator>Rogie</dc:creator>
				<category><![CDATA[CSS]]></category>
		<category><![CDATA[Fine Goods]]></category>
		<category><![CDATA[JavaScript]]></category>
		<category><![CDATA[Portfolio]]></category>
		<category><![CDATA[downloads]]></category>

		<guid isPermaLink="false">http://www.komodomedia.com/?p=2979</guid>
		<description><![CDATA[
Last week, I made and released View.js — a simple, lightweight, jQuery photo viewer for the web. View was created as an answer to all of those massive, bloated lightbox plugins with a load of buttons and styles. I wanted View to be simple, almost zero images and buttons and be customizable not through JavaScript, [...]]]></description>
			<content:encoded><![CDATA[<p><a href="http://finegoodsmarket.com/view"><img src="http://d2dnrmagaqciul.cloudfront.net/wp-content/uploads/2011/11/viewjs.png" alt="" title="viewjs" class="aligncenter size-full wp-image-2978" /></a></p>
<p>Last week, I made and released View.js — a simple, lightweight, jQuery photo viewer for the web. View was created as an answer to all of those massive, bloated lightbox plugins with a load of buttons and styles. I wanted View to be simple, almost zero images and buttons and be customizable not through JavaScript, but through CSS. Thus, View was born.</p>
<p>Head on over to the <a href="http://finegoodsmarket.com/view/">View website</a> and click on the thumbnails to give it a whirl. If you like it, snatch it up. It&#8217;s only ten bucks.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.komodomedia.com/blog/2011/11/view-js-%e2%80%94%c2%a0a-simple-lightweight-jquery-photo-viewer-for-the-web/feed/</wfw:commentRss>
		<slash:comments>9</slash:comments>
		</item>
		<item>
		<title>Rogie&#8217;s Lab</title>
		<link>http://www.komodomedia.com/blog/2011/01/rogie-lab/</link>
		<comments>http://www.komodomedia.com/blog/2011/01/rogie-lab/#comments</comments>
		<pubDate>Mon, 24 Jan 2011 16:41:03 +0000</pubDate>
		<dc:creator>Rogie</dc:creator>
				<category><![CDATA[CSS]]></category>
		<category><![CDATA[CSS3]]></category>
		<category><![CDATA[HTML]]></category>
		<category><![CDATA[HTML5]]></category>
		<category><![CDATA[JavaScript]]></category>
		<category><![CDATA[Lab]]></category>

		<guid isPermaLink="false">http://www.komodomedia.com/?p=2879</guid>
		<description><![CDATA[

Yeah, so I like to tinker around with CSS3/HTML5 and JavaScript. I have a lab now for that.
]]></description>
			<content:encoded><![CDATA[<p><a href="http://lab.komodomedia.com"><br />
<img src="http://d2dnrmagaqciul.cloudfront.net/wp-content/uploads/2011/01/lab.png" alt="" title="lab" width="460" height="300" class="aligncenter size-full wp-image-2880" /></a></p>
<p>Yeah, so I like to tinker around with CSS3/HTML5 and JavaScript. I have a <a href="http://lab.komodomedia.com">lab</a> now for that.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.komodomedia.com/blog/2011/01/rogie-lab/feed/</wfw:commentRss>
		<slash:comments>4</slash:comments>
		</item>
		<item>
		<title>Border Radius Rounded Images and Avatars</title>
		<link>http://www.komodomedia.com/blog/2010/10/border-radius-rounded-images-and-avatars/</link>
		<comments>http://www.komodomedia.com/blog/2010/10/border-radius-rounded-images-and-avatars/#comments</comments>
		<pubDate>Wed, 13 Oct 2010 13:50:15 +0000</pubDate>
		<dc:creator>Rogie</dc:creator>
				<category><![CDATA[CSS]]></category>
		<category><![CDATA[avatar]]></category>
		<category><![CDATA[border-radius]]></category>
		<category><![CDATA[CSS3]]></category>
		<category><![CDATA[img]]></category>

		<guid isPermaLink="false">http://www.komodomedia.com/?p=2642</guid>
		<description><![CDATA[<img src="http://d2dnrmagaqciul.cloudfront.net/wp-content/uploads/2010/10/rounded_avatars.png" />]]></description>
			<content:encoded><![CDATA[<p><img src="http://d2dnrmagaqciul.cloudfront.net/wp-content/uploads/2010/10/rounded_avatars.png" /></p>
<p>As CSS3 is hitting the web hard, rounded stuff is poppin&#8217; up all over the place. Rounded avatars/images are starting to become a reality. Trent Walton has a nice article on <a href="http://trentwalton.com/2010/08/03/css3-border-radius-rounded-avatars/">this here</a>. It&#8217;s pretty simple, just apply a border radius to the <code class="inline">&lt;img&gt;</code> itself, however Firefox and Opera don&#8217;t play well with the border-radius like other browsers do.</p>
<p>I want a solution for Firefox and Opera. As of now, I&#8217;ve not come up with a solution that is truly a mask (meaning it would work well on backgrounds of any color/pattern/texture, but this solution works for Opera, Firefox, Webkit and Chrome on solid color backgrounds.</p>
<h3>Markup</h3>
<p><code>&lt;span class="frame"&gt;<br />
    &lt;img src="/path/to/img.png" /&gt;<br />
&lt;/span&gt;</code></p>
<h3>CSS</h3>
<p><code>.frame{<br />
    display:inline-block;<br />
    position:relative;<br />
    overflow:hidden;<br />
}<br />
.frame>img{<br />
    vertical-align:top;<br />
}<br />
.frame, .frame:before{<br />
    -moz-border-radius:100em;<br />
    border-radius:100em;<br />
}<br />
.frame>img{<br />
    -webkit-border-radius:100em;<br />
}<br />
.frame:before{<br />
    content:'';<br />
    display:block;<br />
    position:absolute;<br />
    left:0;<br />
    right:0;<br />
    width:100%;<br />
    height:100%;<br />
    margin:-10em;<br />
    border:10em solid #1a1a1a;<br />
}</code></p>
<h3>Preview</h3>
<style>.frame{
    display:inline-block;
    position:relative;
    overflow:hidden;
}
.frame>img{
    vertical-align:top;
}
.frame, .frame:before{
    -moz-border-radius:100em;
    border-radius:100em;</p>
<p>}
.frame>img{
    -webkit-border-radius:100em;   
}
.frame:before{
    content:'';
    display:block;
    position:absolute;
    left:0;
    right:0;
    width:100%;
    height:100%;
    margin:-10em;
    border:10em solid #1a1a1a;
}</style>
<p><a  class="frame" href="http://twitter.com/seangaffney"><img src="http://a3.twimg.com/profile_images/353609395/IMG_7473bw_reasonably_small.jpg" /></a> <a class="frame" href="http://twitter.com/seanwes"><img src="http://a3.twimg.com/profile_images/1136130947/twitter-dribbble-profile-pic_reasonably_small.png" /></a> <a class="frame" href="http://twitter.com/squaredeye"><img src="http://a3.twimg.com/profile_images/1100546975/Screen_shot_2010-08-11_at_9.08.03_AM_reasonably_small.png" /></a> <a class="frame" href="http://twitter.com/gedyrivera"><img src="http://a2.twimg.com/profile_images/935982818/avatar_main_copy_square_reasonably_small.jpg" /></a> <a class="frame" href="http://twitter.com/cameronmoll"><img src="http://a2.twimg.com/profile_images/553100134/cameron-400bw-2009-square_reasonably_small.jpg" /></a> </a> <a class="frame" href="http://twitter.com/behoff"><img src="http://a2.twimg.com/profile_images/1133502758/headshot_reasonably_small.jpg" /></a></p>
<h3>Cons</h3>
<p>The biggest con to this technique is that the rounding technique is just a color, not a mask, meaning this works well for solid backgrounds, but not patterned backgrounds :(</p>
<h3>Play with it!</h3>
<p>Wanna mess with the code? Go edit it live on <a href="http://jsfiddle.net/rogie/GnuXw/">JS Fiddle</a>! </p>
]]></content:encoded>
			<wfw:commentRss>http://www.komodomedia.com/blog/2010/10/border-radius-rounded-images-and-avatars/feed/</wfw:commentRss>
		<slash:comments>10</slash:comments>
		</item>
		<item>
		<title>Hud Growl Theme</title>
		<link>http://www.komodomedia.com/blog/2010/03/hud-growl-theme/</link>
		<comments>http://www.komodomedia.com/blog/2010/03/hud-growl-theme/#comments</comments>
		<pubDate>Mon, 29 Mar 2010 16:48:34 +0000</pubDate>
		<dc:creator>Rogie</dc:creator>
				<category><![CDATA[CSS]]></category>
		<category><![CDATA[Nerdlab]]></category>
		<category><![CDATA[Portfolio]]></category>
		<category><![CDATA[design]]></category>
		<category><![CDATA[downloads]]></category>

		<guid isPermaLink="false">http://www.komodomedia.com/?p=2125</guid>
		<description><![CDATA[<img src="http://d2dnrmagaqciul.cloudfront.net/wp-content/uploads/2010/03/hud_post_banner.jpg" alt="Hud, a Growl theme by Komodo" />]]></description>
			<content:encoded><![CDATA[<p><a href="http://www.komodomedia.com/download/#hud-growl-theme"><img src="http://d2dnrmagaqciul.cloudfront.net/wp-content/uploads/2010/03/hud_post_banner.jpg" alt="Hud, a Growl theme by Komodo" /></a></p>
<p>For those of us using a Mac, <a href="http://growl.info/">Growl</a> should essentially be shipped with the system. For years it&#8217;s worked wonders as being a perfect central notification system for any and all system events. From new emails to a Skype message to an upload-just-finished status notification, Growl is a great way to keep me updated.</p>
<p>As great as Growl is, I wanted a new theme. Since Growl themes are webkit and CSS2/3 based, I figured what the heck, I&#8217;ll make one of my own. Best news is I&#8217;m making it publicly available for you too!</p>
<p><a href="http://www.komodomedia.com/download/#hud-growl-theme" class="download">Head on over to the downloads section to download it!</a></p>
<p><small class="sidenote">I captured the Growl notification above against <a href="http://shauninman.com">Shaun Inman</a>&#8217;s Twitter background. So pixelly and delicious :)</small></p>
]]></content:encoded>
			<wfw:commentRss>http://www.komodomedia.com/blog/2010/03/hud-growl-theme/feed/</wfw:commentRss>
		<slash:comments>34</slash:comments>
		</item>
		<item>
		<title>Safari&#8217;s text-shadow anti-aliasing CSS hack Revision</title>
		<link>http://www.komodomedia.com/blog/2009/03/safari-text-shadow-anti-aliasing-css-hack/</link>
		<comments>http://www.komodomedia.com/blog/2009/03/safari-text-shadow-anti-aliasing-css-hack/#comments</comments>
		<pubDate>Tue, 31 Mar 2009 14:33:09 +0000</pubDate>
		<dc:creator>Rogie</dc:creator>
				<category><![CDATA[CSS]]></category>
		<category><![CDATA[Nerdlab]]></category>
		<category><![CDATA[anti-alias]]></category>
		<category><![CDATA[KTSH]]></category>
		<category><![CDATA[safari]]></category>
		<category><![CDATA[text-shadow]]></category>

		<guid isPermaLink="false">http://www.komodomedia.com/?p=1267</guid>
		<description><![CDATA[I want to talk about a fix I found for Safari 3 and 4 for it&#8217;s issues with bad text-rendering with text, especially light text on a dark background. Previously, web developers have been using a text-shadow hack explained here.
I learned of this technique through Bryan Veloso, who was using a black text shadow with [...]]]></description>
			<content:encoded><![CDATA[<p>I want to talk about a fix I found for Safari 3 and 4 for it&#8217;s issues with bad text-rendering with text, especially light text on a dark background. Previously, web developers have been using a <a href="http://sam.brown.tc/entry/348/safaris-text-shadow-anti-aliasing-css-hack">text-shadow hack explained here</a>.</p>
<p>I learned of this technique through <a href="http://avalonstar.com">Bryan Veloso</a>, who was using a black text shadow with zero blur and zero offset to force Safari&#8217;s sub-pixel rendering of text to not appear as a bit more legible, especially on dark backgrounds. Having known nothing of this (I know right, where was I?), I fired up both Safari 3 and Safari 4 to see what was going on. Let&#8217;s check out how Safar 3 and 4 render light text on a dark background.</p>
<h3>Safari 4</h3>
<p>Out of the box, Safari 4&#8217;s font rendering looks good with both light on dark text as well as dark on light text as seen here.</p>
<p><img src="http://d2dnrmagaqciul.cloudfront.net/wp-content/uploads/2009/03/safari_4.gif" alt="Safari 4's Text Rendering" title="Safari 4's Text Rendering" width="460" height="300" class="aligncenter size-full wp-image-1268" /></p>
<h3>Safari 3</h3>
<p>Now I know why this hack was created and <a href="http://equinox-of-insanity.com/2007/08/osx-text-rendering/">you can read more about it here</a>. As you can see in the light on dark background text below, the text is bulky, and almost bleeds the letters together. It looks nothing like the sweet text on the right, which looks clean, crisp and legible.</p>
<p><img src="http://d2dnrmagaqciul.cloudfront.net/wp-content/uploads/2009/03/safari_3.gif" alt="Safari 3's Text Rendering" title="Safari 3's Text Rendering" width="460" height="300" class="aligncenter size-full wp-image-1268" /></p>
<h3>The original text-shadow hack</h3>
<p>Let&#8217;s see the original text-shadow hack, implemented by the following CSS:</p>
<p><code>text-shadow: #000 0 0 0;</code></p>
<h3>Safari 3 with text-shadow hack</h3>
<p><img src="http://d2dnrmagaqciul.cloudfront.net/wp-content/uploads/2009/03/safari_3_tshack.gif" alt="Safari 3's Text Rendering with Hack" title="safari_4_tshack" width="460" height="300" class="aligncenter size-full wp-image-1279" /></p>
<h3>Safari 4 with text-shadow hack</h3>
<p><img src="http://d2dnrmagaqciul.cloudfront.net/wp-content/uploads/2009/03/safari_4_tshack.gif" alt="Safari 4's Text Rendering with Hack" title="safari_4_tshack" width="460" height="300" class="aligncenter size-full wp-image-1279" /></p>
<p>So the fix that fixed Safari 3 seems to have gone a muck in Safari 4. Here&#8217;s where the revised fix comes in. I read over in the comments on <a href="http://sam.brown.tc/entry/348/safaris-text-shadow-anti-aliasing-css-hack">Sam Brown&#8217;s site </a> that you can apply a text shadow similar to the background color on the offending areas to fix this &#8211; in this case, any white background area. I tried it and he&#8217;s right, it works like a charm. However, I thought up a neat little solution, which I&#8217;m sure others have thought of too that fixes both scenarios with one rule:</p>
<p><code>text-shadow:rgba(0,0,0,0.01) 0 0 0;</code></p>
<p><strong>The premise is simple:</strong> use an extremely transparent black (1% visible to be exact). This way the black doesn&#8217;t bleed around the text as seen in the light background case, but is forces Safari to render the text in a more legible manner. Now, let&#8217;s look at what it looks like:</p>
<h3>Safari 4 with revised &#8220;Komodo&#8221; text-shadow hack</h3>
<p><img src="http://d2dnrmagaqciul.cloudfront.net/wp-content/uploads/2009/03/safari_4_new_tshack.gif" alt="Safari 4's Text Rendering with Komodo Hack" title="safari_4_tshack" width="460" height="300" class="aligncenter size-full wp-image-1279" /></p>
<h3>Safari 3 with revised &#8220;Komodo&#8221; text-shadow hack</h3>
<p><img src="http://d2dnrmagaqciul.cloudfront.net/wp-content/uploads/2009/03/safari_3_new_tshack.gif" alt="Safari 4's Text Rendering with Komodo Hack" title="safari_4_tshack" width="460" height="300" class="aligncenter size-full wp-image-1279" /></p>
<p><strong>It&#8217;s beautiful!</strong> I name it the &#8220;Komodo text-shadow hack&#8221; or KTSH for short.</p>
<p>That seems like it does the trick to me, what do you think? </p>
]]></content:encoded>
			<wfw:commentRss>http://www.komodomedia.com/blog/2009/03/safari-text-shadow-anti-aliasing-css-hack/feed/</wfw:commentRss>
		<slash:comments>35</slash:comments>
		</item>
		<item>
		<title>Sexy Music Album Overlays</title>
		<link>http://www.komodomedia.com/blog/2009/03/sexy-music-album-overlays/</link>
		<comments>http://www.komodomedia.com/blog/2009/03/sexy-music-album-overlays/#comments</comments>
		<pubDate>Tue, 17 Mar 2009 21:18:25 +0000</pubDate>
		<dc:creator>Rogie</dc:creator>
				<category><![CDATA[CSS]]></category>
		<category><![CDATA[Nerdlab]]></category>
		<category><![CDATA[Portfolio]]></category>
		<category><![CDATA[Tutorials]]></category>
		<category><![CDATA[design]]></category>
		<category><![CDATA[downloads]]></category>
		<category><![CDATA[album]]></category>
		<category><![CDATA[last.fm]]></category>
		<category><![CDATA[Music]]></category>
		<category><![CDATA[overlay]]></category>
		<category><![CDATA[png]]></category>

		<guid isPermaLink="false">http://www.komodomedia.com/?p=1157</guid>
		<description><![CDATA[<img src="http://d2dnrmagaqciul.cloudfront.net/wp-content/uploads/2009/03/album_banner.jpg" alt="Sexy Album Overlays" />
It's the social web now. We share everything, from our musical tastes, to the<a href="http://twitter.com/rogieking/statuses/1245686411"> bacon avocado burger we ate for breakfast </a>, to the <a href="http://twitter.com/rogieking/statuses/1284215360">very funny things we say and do.</a>

I want to show you how to style your music streams and give you some graphics to do so, cause let's face it, it takes time to design things and it's easier to use mine than yours ;)]]></description>
			<content:encoded><![CDATA[<p><img src="http://d2dnrmagaqciul.cloudfront.net/wp-content/uploads/2009/03/album_banner.jpg" alt="Sexy Album Overlays" /></p>
<div class="post_info">
<ul>
<li>
<h4>Resources</h4>
</li>
<li><a href="http://d2dnrmagaqciul.cloudfront.net/wp-content/uploads/2009/03/sample.zip" class="download">Download Sample File</a></li>
<li><a href="http://www.komodomedia.com/download/#sexy-music-album-overlays" class="download">Download PNG overlays</a></li>
<li><a href="http://d2dnrmagaqciul.cloudfront.net/projects/music_covers/index.html" class="preview">Preview</a></li>
<li><a href="https://www.paypal.com/cgi-bin/webscr?cmd=_donations&#038;business=rogie%40komodomedia%2ecom&#038;item_name=Show some love&#038;no_shipping=0&#038;no_note=1&#038;tax=0&#038;currency_code=USD&#038;lc=US&#038;bn=PP%2dDonationsBF&#038;charset=UTF%2d8">Show Mass Love</a></li>
</ul>
</div>
<p>It&#8217;s the social web now. We share everything, from our musical tastes, to the<a href="http://twitter.com/rogieking/statuses/1245686411"> bacon avocado burger we ate for breakfast </a>, to the <a href="http://twitter.com/rogieking/statuses/1284215360">very funny things we say and do.</a> With amazing <abbr title="Application Programming Interface">APIs</abbr> such as the ones offered by <a href="http://last.fm">Last.fm</a>, <a href="http://twitter.com">Twitter</a>, <a href="http://flickr.com">Flickr</a> and more, we can now put them all on our sites, showing close to real-time updates of the music we are listening to, conversations we are having, and the things we are seeing.  </p>
<p>With this slew of api stew hitting the fan, its no wonder websites and blogs are looking cramped, busy, and ugly. Why not pretty them up a bit? That&#8217;s what I intend to do. I want to show you how to style your music streams and give you some graphics to do so, cause let&#8217;s face it, it takes time to design things and it&#8217;s easier to use mine than yours ;) Alright, enough banter, let&#8217;s get to the goodies.</p>
<h3>The XHTML</h3>
<p>Keeping it simple and semantic, we describe our &#8220;list&#8221; of music with an unordered list. We link the title and supply a thumbnail image to bring some life to the album. In the real world, fill your alt attributes and titles with some helpful information for those using screen readers. Simple enough eh?<br />
<code>&lt;ul class="music"&gt;<br />
	&lt;li&gt;<br />
		&lt;a href="..."&gt;Hungry Like the Wolf: Duran Duran&lt;/a&gt;<br />
		&lt;img src="albums/duran.jpg" alt="..." /&gt;<br />
	&lt;/li&gt;<br />
&lt;/ul&gt;</code></p>
<h3>The PNG Overlays</h3>
<p>Next, if we are talking sexy, we need sexy <abbr title="Portable Network Graphic">PNG</abbr> images designed to lay over the images. This way, our list doesn&#8217;t look like the same old boring square 50px x 50px image (like everybody else and their llama&#8217;s neighbor has). This is the part where you get lucky and get some freebies thrown your way. Here are three <abbr title="Portable Network Graphic">PNG</abbr> images that I&#8217;ve designed (perhaps inspired by some music apps around the intarweb) that are free for you to do whatever you&#8217;d like with. Yes, even that.</p>
<h4>Jewel Case</h4>
<p><img src="http://d2dnrmagaqciul.cloudfront.net/wp-content/uploads/2009/03/jewel.png" alt="Jewel Case" /> </p>
<h4>Vinyl Record Sleeve</h4>
<p><img src="http://d2dnrmagaqciul.cloudfront.net/wp-content/uploads/2009/03/vinyl.png" alt="Vinyl Record Sleeve" /></p>
<h4>Compact Disc</h4>
<p><img src="http://d2dnrmagaqciul.cloudfront.net/wp-content/uploads/2009/03/cd.png" alt="Compact Disc" /> </p>
<h3>The <abbr title="Cascading Style Sheet">CSS</abbr></h3>
<p>Now that we have some sweet looking markup, and the <abbr title="Portable Network Graphic">PNG</abbr> overlays ain&#8217;t that bad either, let&#8217;s get to rocking the stylesheet to make this all come together in a beautiful matrimony&#8230;or something like that.</p>
<p>Okay, the first thing I am going to do in lieu of a <a href="http://meyerweb.com/eric/thoughts/2008/01/15/resetting-again/">reset stylesheet</a> is just reset what I am working with like so:</p>
<p><code>ul.music,<br />
ul.music li,<br />
ul.music li a,<br />
ul.music li img{<br />
	margin:0;<br />
	padding:0;<br />
	list-style:none;<br />
	border:0;<br />
	text-decoration:none;<br />
}</code></p>
<p>Next, I want a little bit of margin (or spacing) between my list of albums. This is totally up to you, but I decided to go with 15 pixels. Also, I want the albums to show up in a row and then line wrap when they reach the edge of the containing element. To do this, I float the list items left:</p>
<p><code>ul.music li{<br />
	margin:15px 15px 15px 0;<br />
	float:left;<br />
	position:relative;<br />
}</code></p>
<p>Okay, the next rule will style the link to the album and it gets a little more hairy. I&#8217;ll explain the premise of the style and you can fill in the gaps of how it works. The idea is that we can use the link as the album overlay if we set the PNG image as the background (for this example, we are using the vinyl overlay). As long as we put the link over the image (z-index and relative positioning) and set the dimensions (block display, width and height) of the link to that of the PNG overlay, it should work. </p>
<p>Also, I decided for my implementation, that I didn&#8217;t want the text of the album to show, hence the negative <code class="inline">text-indent</code> rule and <code class="inline">overflow:hidden;</code> to keep that negative text indent from showing. You can keep the album text with a few additional styles.</p>
<p><code>ul.music li a{<br />
	display:block;<br />
	position:relative;<br />
	background:url(vinyl.png) 0 0 no-repeat;<br />
	float:left;<br />
	width:90px;<br />
	height:82px;<br />
	text-indent:-1000em;<br />
	overflow:hidden;<br />
	z-index:1;<br />
}</code></p>
<p>If you&#8217;ve done your math, we&#8217;ve only got one more tag to style: the <code class="inline">img</code> tag. The idea with styling this is very simple. Just set the dimensions of the image to that of the viewport of the PNG overlay and position the top-left coordinate so that the image lines up perfectly in the viewport. We use absolute positioning so that this image doesn&#8217;t affect the size or layout of it&#8217;s parent list item and position it right in the viewport of the vinyl png image, in this case at the 2px, 1px coordinate:</p>
<p><code>ul.music li img{<br />
	position:absolute;<br />
	width:72px;<br />
	height:72px;<br />
	left:2px;<br />
	top:1px;<br />
}</code></p>
<h3>Wait, what if there isn&#8217;t album art?</h3>
<p>That&#8217;s right. You are special. You listen to underground music. This music is so underground and obscure, that not even the most savvy of databases can capture your unique taste, leaving you with a bunch of empty albums and no art. Well, you rogue you, I&#8217;ve got some CSS to fix that. We still have one more tag we can use as a background and that is the <code class="inline">li</code>. I&#8217;ve whipped up some empty album art as well and we&#8217;ll use it for the blank state. All we need to do now is position the blank album insert in the &#8220;viewport&#8221; of the PNG overlay like so. Voila!</p>
<p><code>ul.music li{<br />
	background:url(blank_insert.gif) 2px 1px no-repeat;<br />
}</code></p>
<h3>That&#8217;s it!</h3>
<p>Yeah right. There&#8217;s always the dreaded two-headed beast Internet Explorer. Let&#8217;s have a little chat about how Internet Explorer jacks things up for us web designers. First of all, <abbr title="Internet Explorer 7">IE7</abbr> really doesn&#8217;t give us that much grief. It&#8217;s biggest flaw is that it sucks big time at rendering images at any size other  than its inherent size. What does this mean? Well, if an image has dimensions of 100px by 100px and you set the size (as we did) to 72px by 72px, <abbr title="Internet Explorer 7">IE7</abbr> basically takes a dump on itself and renders it with jaggies and all gross. Luckily we can fix it&#8217;s issues with the following CSS rule:</p>
<p><code>img {<br />
	-ms-interpolation-mode:bicubic;<br />
}</code></p>
<p>Wow. That was way too easy for an Internet Explorer issue. Ahhh, don&#8217;t worry, more pain will come.  Next, as we all know, Internet Explorer 6 sucks at displaying PNG images with alpha transparency. Wow. Big surprise. Luckily, there is another Microsoft-specific CSS rule that we can use to overcome this impairment. Here is the code that makes <abbr title="Internet Explorer 6">IE6</abbr> behave like a red-headed stepchild should:</p>
<p><code>ul.music li.vinyl a{<br />
	background:none;<br />
	filter:progid:DXImageTransform.Microsoft.AlphaImageLoader(src='vinyl.png', sizingMethod='crop');<br />
}</code></p>
<h3>That&#8217;s it for realz?</h3>
<p>Yes, that&#8217;s it for reals! Now you can make your Last.fm music playlists all sexy. Two words of advice. One, if you want to be mega nice, link my site as a thank you, but you don&#8217;t have to. Two, get out and make the web beautiful! Here are some resources to get you on your way:</p>
<ul>
<li><a href="http://www.komodomedia.com/download/#sexy-music-album-overlays" class="download">Download the PNG overlays in this article</a></li>
<li><a href="http://www.komodomedia.comwp-content/uploads/2009/03/sample.zip" class="download">Download a Sample File</a></li>
<li><a href="http://d2dnrmagaqciul.cloudfront.net/projects/music_covers/" class="preview">View the complete CSS and XHTML for this article</a></li>
<li><a href="http://www.command-tab.com/2008/09/06/fmtuner-a-lastfm-plugin-for-wordpress/">Last.fm Plugin for WordPress</a></li>
<li><a href="http://www.last.fm/download">Last.fm apps</a>, <a href="http://www.sophiestication.com/coversutra/">CoverSutra</a> &amp; <a href="http://bowtieapp.com">BowTie</a>: iTunes controllers/Last.fm <a href="http://www.netlingo.com/word/scrobble.php">scrobblers</a></a>
</ul>
<h3>Update</h3>
<p>So far, I haven&#8217;t seen many sites using these overlays, but here are a few. I&#8217;d love to see how people are using it and where, so <a href="/contact">drop a line and let me know</a>. Here are a few sites that are using these album overlays:</p>
<ul>
<li><strong>James Lao</strong> &#8211; <a href="http://jameslao.com/">http://jameslao.com</a></li>
<li><strong>Maniacal Rage</strong> &#8211; <a href="http://log.maniacalrage.net/post/130206922/april-may-and-june-music-purchases">http://log.maniacalrage.net/</a></li>
<li><strong>Hello! Ranking</strong> &#8211; <a href="http://www.thello-ranking.com/">http://www.hello-ranking.com</a></li>
<li><strong>In Hearts Wake</strong> &#8211; <a href="http://inheartswake.com/">http://inheartswake.com/</a></li>
<li><strong>Phunky</strong> &#8211; <a href="http://phunky.co.uk/">http://phunky.co.uk/</a></li>
<li><strong>Chris Wallace</strong> &#8211; <a href="http://chris-wallace.com">http://www.chris-wallace.com/</a></li>
<li><strong>Jack and Diana</strong> &#8211; <a href="http://jakeanddiana.com/">http://jakeanddiana.com/</a></li>
<li><strong>Gilbert Pellegrom</strong> &#8211; <a href="http://www.gilbertpellegrom.co.uk/">http://www.gilbertpellegrom.co.uk/</a></li>
<li><strong>The Things I Do</strong> &#8211; <a href="http://www.thethingsido.net/">http://www.thethingsido.net</a></li>
</ul>
]]></content:encoded>
			<wfw:commentRss>http://www.komodomedia.com/blog/2009/03/sexy-music-album-overlays/feed/</wfw:commentRss>
		<slash:comments>93</slash:comments>
		</item>
		<item>
		<title>CSS Sliding Sprite Windows</title>
		<link>http://www.komodomedia.com/blog/2008/09/css-sliding-sprite-windows/</link>
		<comments>http://www.komodomedia.com/blog/2008/09/css-sliding-sprite-windows/#comments</comments>
		<pubDate>Mon, 01 Sep 2008 18:03:40 +0000</pubDate>
		<dc:creator>Rogie</dc:creator>
				<category><![CDATA[CSS]]></category>
		<category><![CDATA[Nerdlab]]></category>
		<category><![CDATA[techniques]]></category>
		<category><![CDATA[xHTML]]></category>

		<guid isPermaLink="false">http://www.komodomedia.com/?p=277</guid>
		<description><![CDATA[<img src="http://d2dnrmagaqciul.cloudfront.net/wp-content/uploads/2008/09/sliding_banner.jpg" alt="" title="sliding_banner" width="460" height="180" class="alignnone size-full wp-image-278" />
I want to share a CSS technique I've used alot. I'm sure that you have seen CSS sprite techniques that utilize changing background position on hover to change a link's state.  Also, they have the added benefit of keeping from loading images on hover, limiting lag. This technique is very similar, but works like a charm for IE6 and PNG images.  I know this may be a <a href="http://www.urbandictionary.com/define.php?term=moo+point">moo point </a>at this stage, because IE6 is on the outs, but still works beautifully as a technique.]]></description>
			<content:encoded><![CDATA[<p><img src="http://d2dnrmagaqciul.cloudfront.net/wp-content/uploads/2008/09/sliding_banner.jpg" alt="" title="sliding_banner" width="460" height="180" class="alignnone size-full wp-image-278" /></p>
<div class="post_info">
<ul>
<li>
<li><a class="download" href="http://www.komodomedia.comwp-content/uploads/2008/09/css_sliding_sprite_windows.zip">Download Example</a></li>
<li><a class="preview" href="http://d2dnrmagaqciul.cloudfront.net/samples/css_sliding_sprite_windows/index.html">Preview/Code</a></li>
</ul>
</div>
<p>I want to share a CSS technique I&#8217;ve used alot. I&#8217;m sure that you have seen CSS sprite techniques that utilize changing background position on hover to change a link&#8217;s state.  Also, they have the added benefit of keeping from loading images on hover, limiting lag. This technique is very similar, but works like a charm for IE6 and PNG images.  I know this may be a <a href="http://www.urbandictionary.com/define.php?term=moo+point">moo point </a>at this stage, because IE6 is on the outs, but still works beautifully as a technique.</p>
<p>Let&#8217;s jump right in, as I don&#8217;t have a lot of my Labor day to give.</p>
<p>First, as always, I want to preview this thing and see what it does. Here&#8217;s your preview:</p>
<link rel="stylesheet" href="http://d2dnrmagaqciul.cloudfront.net/samples/css_sliding_sprite_windows/index.css" type="text/css" media="all" />
<a target="donate" style="margin:0 auto;" href="https://www.paypal.com/cgi-bin/webscr?cmd=_donations&#038;business=rogie%40komodomedia%2ecom&#038;item_name=Donate%20a%20Java&#038;amount=4%2e00&#038;no_shipping=0&#038;no_note=1&#038;tax=0&#038;currency_code=USD&#038;lc=US&#038;bn=PP%2dDonationsBF&#038;charset=UTF%2d8" id="buyme_coffee"><span>Buy me a coffee</span></a><br />
You get the picture. Hover it, click it, etc&#8230;the button has different states.</p>
<h3>Aight, the meat and potatoes: the XHTML</h3>
<p>So, the markup is pretty simple. It&#8217;s basically a link with a span in it. Check it:</p>
<p><code>&lt;a href="..." id="buyme_coffee"&gt;<br />
   &lt;span&gt;Buy me a coffee&lt;/span&gt;<br />
&lt;/a&gt;</code></p>
<h3>How it works</h3>
<p>Before looking at the CSS, it helps to know how it works. Think of it as a window to a larger canvas behind it. It&#8217;s easy to think of it in terms of the two elements:</p>
<ul>
<li><strong>The window</strong>: The <code class="inline"> A </code> tag</li>
<li><strong>The canvas</strong>: The <code class="inline"> SPAN </code> tag</li>
</ul>
<p>The window only shows a portion (a view) of the canvas.  The canvas can be any size.  By changing the position of the canvas, you can pan a different portion of it into the window.  The window is fixed width, fixed height, and any overflowing content is hidden. This way, only the portion of the canvas in the window view is visible.</p>
<h3>The CSS</h3>
<p><code>#buyme_coffee,<br />
#buyme_coffee span{<br />
	display:block;<br />
	width:160px;<br />
	height:40px;<br />
	position:relative;<br />
	overflow: hidden;<br />
}<br />
#buyme_coffee span{<br />
	height:120px;<br />
	background: url(coffee_button.png) 0 0 no-repeat;<br />
	text-indent:-9000px;<br />
}<br />
#buyme_coffee:hover span{<br />
	top:-40px;<br />
}<br />
#buyme_coffee:active span,<br />
#buyme_coffee:focus span{<br />
	top:-80px;<br />
}</code></p>
<p><strong>The first selector </strong>targets two tags, the <code class="inline">#buyme_coffee</code> link and the <code class="inline">#buyme_coffee span</code> span inside the link.  I&#8217;m doubling up the rules by targeting both tags because both tags share quite a few similar tags. As for the rules that are different, I&#8217;ll correct in the next selector. </p>
<p>This first selector sets both <code class="inline">A</code> tag and <code class="inline">SPAN</code> tags to block (since they are inline by default), sets the width and height, and then sets the overflow to hidden.  The <code class="inline">overflow:hidden</code> here is the key. This causes the <code class="inline">A</code> tag to act as a window that only views the content in its height x width box.  All other content is simply cutoff or put away from view.</p>
<p><strong>The second selector</strong>, <code class="inline">#buyme_coffee span</code>, resets the height to the height of the background image, which is larger than the viewport (<code class="inline">A</code> tag), but gets cutoff from view.  The <code class="inline">text-indent:-9000px</code> is a cheap way of shoving the text off the screen so that this text is replaced by the background image. The background image contains the three states we want: Default, Hover and Focus/Active.  Here&#8217;s a preview of that background image:<br />
<img src="http://www.komodomedia.comwp-content/uploads/2008/09/coffee_button.png" alt="CSS sliding sprite window button image"/></p>
<p>You probably guessed it.  The top image will show as default.</p>
<p>K, we&#8217;re almost done.  <strong>The third and fourth selectors</strong> target the <code class="inline">:hover</code> and the <code class="inline">:active</code> and <code class="inline">:focus</code> states respectively.  This is uber simple.  When the link (or window) is hovered, push the top of the span (or canvas) up by 40px, showing the hover state.  When the link is active or focused, push the span up by 80px, revealing the active state.</p>
<p>That&#8217;s it!  So why is this better than just panning the background position you ask? Good question.  I started using this method when I needed to make the background an alpha-transparent PNG, which as you know, doesn&#8217;t display correctly unless you use an <a href="http://www.komodomedia.com/blog/2007/11/css-png-image-fix-for-ie/">IE alpha image loader filter</a>, which as you know doesn&#8217;t play nicely with background image positions.  With this method, you can apply an alpha image loader filter to the <code class="inline">span</code> element and it works like a charm.</p>
<p>Hope you enjoy. Cheers!</p>
<p><strong>Update:</strong> Based on @Justin&#8217;s suggestion, I&#8217;ve included some modified CSS below to show this technique sans the a <code class="inline">text-indent:-9000px</code> for screen reader friendliness. A <a href="http://d2dnrmagaqciul.cloudfront.net/samples/css_sliding_sprite_windows/index2.html">demo of the modified CSS can be seen here.</a></p>
<p><code>#buyme_coffee,<br />
#buyme_coffee span{<br />
	display:block;<br />
	width:160px;<br />
	height:40px;<br />
	position:relative;<br />
	overflow: hidden;<br />
}<br />
#buyme_coffee span{<br />
	height:140px;<br />
	background: url(coffee_button.png) 0 0 no-repeat;<br />
	line-height: 20px;<br />
	white-space: nowrap;<br />
	top:-20px;<br />
}<br />
#buyme_coffee:hover span{<br />
	top:-60px;<br />
}<br />
#buyme_coffee:active span,<br />
#buyme_coffee:focus span{<br />
	top:-100px;<br />
}</code></p>
]]></content:encoded>
			<wfw:commentRss>http://www.komodomedia.com/blog/2008/09/css-sliding-sprite-windows/feed/</wfw:commentRss>
		<slash:comments>18</slash:comments>
		</item>
		<item>
		<title>CSS PNG Image Fix for IE</title>
		<link>http://www.komodomedia.com/blog/2007/11/css-png-image-fix-for-ie/</link>
		<comments>http://www.komodomedia.com/blog/2007/11/css-png-image-fix-for-ie/#comments</comments>
		<pubDate>Tue, 06 Nov 2007 06:49:16 +0000</pubDate>
		<dc:creator>Rogie</dc:creator>
				<category><![CDATA[CSS]]></category>
		<category><![CDATA[Geekery]]></category>
		<category><![CDATA[JavaScript]]></category>
		<category><![CDATA[Nerdlab]]></category>
		<category><![CDATA[Tutorials]]></category>

		<guid isPermaLink="false">http://komodomedia.com/blog/index.php/2007/11/05/css-png-image-fix-for-ie/</guid>
		<description><![CDATA[We&#8217;ve all seen them, the hoards of PNG fixes for IE6.  That is because IE6 is a bag of smashed buttholes.  I&#8217;m serious. It is.  That is why we (web designers of the new world) have to continually come up with creative ways to solve the PNG issue. In case you are [...]]]></description>
			<content:encoded><![CDATA[<p>We&#8217;ve all seen them, the <a href="http://www.twinhelix.com/css/iepngfix/demo/">hoards</a> of <a href="http://www.bioneural.net/2006/08/09/valid-fix-for-png-transparency-on-a-single-image/">PNG fixes for IE6</a>.  That is because IE6 is a bag of smashed buttholes.  I&#8217;m serious. It is.  That is why we (web designers of the new world) have to continually come up with creative ways to solve the PNG issue. In case you are lost, just realize that in IE6, PNG images with transparency do not show their transparent regions, so you have to use some crazy IE6 proprietary filters. Moving on.</p>
<p>Lately, in projects I have been using a modified CSS snippet I found out on the interwebs to <a href="http://www.urbandictionary.com/define.php?term=automagic">automagically</a> replace PNG images with their <a href="http://msdn2.microsoft.com/en-us/library/ms532969.aspx">AlphaImageLoader</a> equivalent in IE6.  Check this out here and I&#8217;ll explain and give an example:</p>
<h2>The CSS/Code</h2>
<p><code class="css">* html img,<br />
* html .png{<br />
    position:relative;<br />
    behavior: expression((this.runtimeStyle.behavior="none")&amp;&amp;(this.pngSet?this.pngSet=true:(this.nodeName == "IMG" &#038;&#038; this.src.toLowerCase().indexOf('.png')>-1?(this.runtimeStyle.backgroundImage = "none",<br />
        this.runtimeStyle.filter = "progid:DXImageTransform.Microsoft.AlphaImageLoader(src='" + this.src + "', sizingMethod='image')",<br />
        this.src = "transparent.gif"):(this.origBg = this.origBg? this.origBg :this.currentStyle.backgroundImage.toString().replace('url("','').replace('")',''),<br />
        this.runtimeStyle.filter = "progid:DXImageTransform.Microsoft.AlphaImageLoader(src='" + this.origBg + "', sizingMethod='crop')",<br />
        this.runtimeStyle.backgroundImage = "none")),this.pngSet=true)<br />
    );<br />
}</code><em><strong>Update:</strong> This code changed to remove the behavior at runtime based on <a href="http://komodomedia.com/blog/index.php/2007/11/05/css-png-image-fix-for-ie/#comment-125714">@Thierry&#8217;s suggestion</a>.</em></p>
<p>For you purists out there, this is <strong>extremely</strong> <a href="http://www.urbandictionary.com/define.php?term=hax0r">hacky</a>, so you may want to <a href="http://www.simplebits.com/">skip this whole entry entirely</a>. </p>
<p><strong>Update: </strong>: CSS Conditional comments for IE are a perfect way of hiding this hacky code from the good browsers. Here is a way to bring in the CSS for only IE 6 and below:</p>
<p><code>&lt;!--[if lte IE 6]&gt;<br />
&lt;link rel="stylesheet" type="text/css" href="png_fix.css" /&gt;<br />
&lt;![endif]--&gt;</code></p>
<p>Ok, there won&#8217;t be much in the way of explanation here, but let me explain what this little bad-boy does. </p>
<h2>The Selectors</h2>
<p><code>* html img,<br />
* html .png</code></p>
<p>The selector portion of the CSS rule targets which XHTML tags/classes this rule will be applied to.  At first glance, it looks like all <code class="inline">img</code> tags as well as all tags with a class of <code class="inline">"png"</code>.  You&#8217;ll notice the  <code class="inline">(star) html</code>  in front of both of these. Wait, there is no &#8220;anytag&#8221; preceding the <code class="inline">html</code> tag, so this won&#8217;t get applied! True.  For all non-crappy (that is a pro term by the way) browsers, this rule won&#8217;t get applied.  However, since IE6 is a pile, it thinks that there is a tag before the <code class="inline">html</code> tag, so it will apply this rule.  Great! Now IE6 is the only browser that will use this rule.</p>
<h2>The Rest of the Code Jargon</h2>
<p>Honestly, the rest you really don&#8217;t want to mess with much, but it suffices to say that this expression does a few things:</p>
<ul>
<li><strong>If the tag is an <code class="inline">IMG</code> tag</strong>, the expression checks to see if it is a .PNG image.  If so, it applies a CSS <a href="http://msdn2.microsoft.com/en-us/library/ms532969.aspx">AlphaImageLoader</a> filter to the IMG tag to load the PNG file as a background image.  It then points the src attribute of the image to a <a href="http://d2dnrmagaqciul.cloudfront.net/wp-content/uploads/2007/11/transparent.gif">transparent gif</a> so that the image isn&#8217;t overlaying it&#8217;s own background. Voila! <em>Note:  This only works well for images not resized by the browser. Also, you&#8217;ll need a <a href="http://d2dnrmagaqciul.cloudfront.net/wp-content/uploads/2007/11/transparent.gif">transparent gif 1px by 1px image</a> on your server.</em></li>
<li><strong>If the tag is not an <code class="inline">IMG</code> tag</strong>, then this expression takes the CSS given background image and shoves it into a background <a href="http://msdn2.microsoft.com/en-us/library/ms532969.aspx">AlphaImageLoader</a> filter.  It then removes the real CSS <code class="inline">background-image</code> rule so that the background and the filter are not conflicting.</li>
</ul>
<p>Pretty cool!  Please note that this CSS expression is pretty generic.  If you have some crazy CSS-ing to do, you might want to stick with using your own methods or apply the <a href="http://msdn2.microsoft.com/en-us/library/ms532969.aspx">AlphaImageLoader</a> filter manually.</p>
<p>Also, if you are a standards-compliant junkie and this brushes you wrong, remember that this is intended to help with the crud of browsers.  Sometimes we have to break our own rules to do the job.  </p>
<h2>A Demo!</h2>
<p>Let&#8217;s see a demo!  See the goodness below:</p>
<h3>My Image Tag:</h3>
<div style="background:url(http://komodomedia.com/wp-content/uploads/2007/11/checkerboard.gif); padding: 20px;">
<link rel="stylesheet" href="http://d2dnrmagaqciul.cloudfront.net/wp-content/uploads/2007/11/png_fix.css" type="text/css" media="all" />
<img src="http://d2dnrmagaqciul.cloudfront.net/wp-content/uploads/2007/11/twitterific.png" width=128" height="128" alt="Twitterific Rules"/>
</div>
<h3>My Generic Tag</h3>
<div style="background:url(http://komodomedia.com/wp-content/uploads/2007/11/checkerboard.gif); padding: 20px;">
<div id="generic_tag_png" class="png"> <strong>Wish I could Play.</strong> </div>
</div>
<h3>My Link Tag</h3>
<p><em><strong>Update:</strong> Links will need an additional rule of <code class="inline">cursor: pointer;</code> to restore the cursor. I&#8217;ll have to change that in the script to do that automatically</em></p>
<div style="background:url(http://komodomedia.com/wp-content/uploads/2007/11/checkerboard.gif); padding: 20px;">
<a id="link_tag_png" class="png" href="http://www.apple.com/retail/fifthavenue/week/20071104.html"> <strong>This is my link. </strong> </a>
</div>
]]></content:encoded>
			<wfw:commentRss>http://www.komodomedia.com/blog/2007/11/css-png-image-fix-for-ie/feed/</wfw:commentRss>
		<slash:comments>181</slash:comments>
		</item>
		<item>
		<title>Alternating row classes in PHP, easy style</title>
		<link>http://www.komodomedia.com/blog/2007/03/alternating-row-classes-in-php-easy-style/</link>
		<comments>http://www.komodomedia.com/blog/2007/03/alternating-row-classes-in-php-easy-style/#comments</comments>
		<pubDate>Fri, 30 Mar 2007 17:40:37 +0000</pubDate>
		<dc:creator>Rogie</dc:creator>
				<category><![CDATA[CSS]]></category>
		<category><![CDATA[Tumblelog]]></category>
		<category><![CDATA[Tutorials]]></category>

		<guid isPermaLink="false">http://komodomedia.com/blog/index.php/2007/03/30/alternating-row-classes-in-php-easy-style/</guid>
		<description><![CDATA[Ok.  I have seen a myriad of techniques on creating the PHP code to pump out alternating row classes on tables, list elements, what have you.  It&#8217;s usually some counter variable that you divide by 2 to see if there is an even result (MOD operator).  But then you got the whole [...]]]></description>
			<content:encoded><![CDATA[<p>Ok.  I have seen a myriad of techniques on creating the PHP code to pump out alternating row classes on tables, list elements, what have you.  It&#8217;s usually some counter variable that you divide by 2 to see if there is an even result (MOD operator).  But then you got the whole initialize the variable, increment the variable, test the variable scenario. Blegh.</p>
<p>I&#8217;ve also seen some crazy technique using bitwise &#038; operators, which is hardly readable for common folk, but I do admit is probably blazing fast.  Only issue there, once again, you are maintaining a counter variable and incrementing it.  Blegh.</p>
<p>I do not claim for this method to be better. I simply claim that this is my method and I use it.  Take it as you will.  When in Rome&#8230;</p>
<h3>First, lets set up a style</h3>
<p><code>&lt;style&gt;<br />
	tr.alt td{<br />
		background-color:#D5E0E1;<br />
	}<br />
&lt;/style&gt;</code><br />
Done&#8230;</p>
<h3>Next, the PHP code intermingled with some HTML</h3>
<p><code>&lt;?php<br />
for($i = 0; $i &lt; 10; ++$i){<br />
	$row_class = empty($row_class)? "alt" : "";<br />
	echo("<br />
		&lt;tr class=\"$row_class\"><br />
			&lt;td&gt;<br />
				data 1<br />
			&lt;/td&gt;<br />
			&lt;td&gt;<br />
				data 2<br />
			&lt;/td&gt;<br />
			&lt;td&gt;<br />
				data 3<br />
			&lt;/td&gt;<br />
		&lt;/tr&gt;");<br />
}<br />
?&gt;</code></p>
<p>The key for the alternating row classes of course, lies in one line of PHP code:<br />
<code>$row_class = empty($row_class)? "alt" : "";</code></p>
<p>Basically, I&#8217;m using PHP shorthand to do an if statement and check if the variable $row_class is empty or a blank string (&#8220;&#8221;).  If it is then I set it to &#8220;alt&#8221;.  As you can imagine, next row, the same statement is ran.  This time, it&#8217;s not empty, so it gets set to empty, thus alternating between the &#8220;alt&#8221; class and empty.  </p>
<p>Done&#8230;Seacrest out.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.komodomedia.com/blog/2007/03/alternating-row-classes-in-php-easy-style/feed/</wfw:commentRss>
		<slash:comments>16</slash:comments>
		</item>
	</channel>
</rss>

<!-- Served from: komodomedia.com @ 2012-02-10 14:26:17 by W3 Total Cache -->
