<?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>SNEAKY.ME &#187; tutorial</title>
	<atom:link href="http://sneaky.me/tag/tutorial/feed/" rel="self" type="application/rss+xml" />
	<link>http://sneaky.me</link>
	<description></description>
	<lastBuildDate>Fri, 11 Feb 2011 09:53:07 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.2.1</generator>
		<item>
		<title>CSS Sprites</title>
		<link>http://sneaky.me/2009/06/css-sprites/</link>
		<comments>http://sneaky.me/2009/06/css-sprites/#comments</comments>
		<pubDate>Thu, 11 Jun 2009 22:27:54 +0000</pubDate>
		<dc:creator>Jason</dc:creator>
				<category><![CDATA[Things]]></category>
		<category><![CDATA[css]]></category>
		<category><![CDATA[development]]></category>
		<category><![CDATA[tutorial]]></category>
		<category><![CDATA[web]]></category>

		<guid isPermaLink="false">http://sneaky.me/?p=603</guid>
		<description><![CDATA[The other day while working on a web project for a client I was looking for an easy way to switch out images for the different button states (ie. regular, hover, and active) in a typical navigation menu. I&#8217;ve always taken what I thought to be the most logical approach and just used CSS to [...]]]></description>
			<content:encoded><![CDATA[<p>The other day while working on a web project for a client I was looking for an easy way to switch out images for the different button states (ie. regular, hover, and active) in a typical navigation menu. I&#8217;ve always taken what I thought to be the most logical approach and just used CSS to change the background-image depending on whatever state was currently invoked. But, this leads to lag in image load time due to the browser &#8220;calling&#8221; and waiting for the other image to be served by the web server and sometimes with Internet Explorer this method can cause a flicker effect. Not the end of the world of course but still not desirable.</p>
<p>So, I remember reading about CSS sprites a year or so ago but never used them until the other day. Basically a sprite is an image with many images inside it. Facebook for example takes this to the extreme. They utilize CSS sprites to <a rel="nozoom" href="http://sneaky.me/wp-content/uploads/2009/06/UIRoundedImage.png">round the corners</a> of your profile pic and for some <a rel="nozoom" href="http://sneaky.me/wp-content/uploads/2009/06/MegaSprite_5004_ltr.png">other uses</a> as well. Take a look at the linked images and you&#8217;ll probably get where this is going.</p>
<p>Basically instead of having multiple images swapped in and out by CSS you create one master image and use CSS to reposition the background-image to suit your needs depending on what section of the sprite you want to display to the user. No load lag and no flicker. Pretty snazzy&#8230;</p>
<p>I found two tutorials online which were easy to follow and within minutes I fully understood how to use and manipulate sprites via CSS. The <a href="http://www.alistapart.com/articles/sprites/">first one</a> I read was written by Dave Shea for the website &#8220;A List Apart&#8221;. The <a href="http://wellstyled.com/css-nopreload-rollovers.html">second one</a> was from &#8220;Well Styled&#8221;.</p>
<p>Check out both the tutorials above and I&#8217;m sure you&#8217;ll agree this is the best, most elegant way to do this type of image manipulation. This may be old news so to speak but I thought it was still worth looking at again. I hope you find the info as useful as I did.</p>
]]></content:encoded>
			<wfw:commentRss>http://sneaky.me/2009/06/css-sprites/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
	</channel>
</rss>

