<?xml version="1.0" encoding="UTF-8"?>
<?xml-stylesheet type="text/xsl" media="screen" href="/~d/styles/rss2full.xsl"?><?xml-stylesheet type="text/css" media="screen" href="http://feeds.feedburner.com/~d/styles/itemcontent.css"?><rss 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/" xmlns:creativeCommons="http://backend.userland.com/creativeCommonsRssModule" xmlns:feedburner="http://rssnamespace.org/feedburner/ext/1.0" version="2.0">

<channel>
	<title>CSS-Tricks</title>
	
	<link>http://css-tricks.com</link>
	<description>Tips, Tricks, and Techniques on using Cascading Style Sheets.</description>
	<lastBuildDate>Fri, 06 Nov 2009 11:45:39 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.8.5</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<creativeCommons:license>http://creativecommons.org/licenses/by/2.0/</creativeCommons:license><image><link>http://css-tricks.com</link><url>http://css-tricks.com/images/Feedburner-Banner.jpg</url><title>CSS-Tricks</title></image><atom10:link xmlns:atom10="http://www.w3.org/2005/Atom" rel="self" href="http://feeds.feedburner.com/CssTricks" type="application/rss+xml" /><feedburner:emailServiceId>CssTricks</feedburner:emailServiceId><feedburner:feedburnerHostname>http://feedburner.google.com</feedburner:feedburnerHostname><atom10:link xmlns:atom10="http://www.w3.org/2005/Atom" rel="hub" href="http://pubsubhubbub.appspot.com" /><item>
		<title>Quickie CSS3 Tricks with Fallbacks</title>
		<link>http://feedproxy.google.com/~r/CssTricks/~3/AM-QPZGQohw/</link>
		<comments>http://css-tricks.com/quickie-css3-tricks-with-fallbacks/#comments</comments>
		<pubDate>Fri, 06 Nov 2009 11:45:39 +0000</pubDate>
		<dc:creator>Chris Coyier</dc:creator>
				<category><![CDATA[Article]]></category>

		<guid isPermaLink="false">http://css-tricks.com/?p=4632</guid>
		<description>CSS3 can do some seriously neat stuff. Just check out some of the crazy 3D stuff you can do in WebKit.  But as we all know, we need to be careful with what we choose to do with it. The most cutting edge techniques are fun to play with, but since since only a [...]</description>
			<content:encoded><![CDATA[<p>CSS3 can do some seriously neat stuff. Just check out some of the <a href="http://webkit.org/blog/386/3d-transforms/">crazy 3D stuff</a> you can do in WebKit.  But as we all know, we need to be careful with what we choose to do with it. The most cutting edge techniques are fun to play with, but since since only a sliver of browsers support them fully, we can only use them in circumstances where they fall back to otherwise perfectly acceptable styling. Let&#8217;s look at a couple of quick, simple, cheezy examples.</p>
<p><span id="more-4632"></span></p>
<p>&nbsp;</p>
<h3>Growing Links</h3>
<p>Scaling an element is really fun any easy with CSS3. We don&#8217;t need CSS3 to do this, we could use relative positioning, offset the position, increase the width, height, and font size. But wow, that&#8217;s a heck of a lot of work when we can just apply a scale factor and be done with it. These links get their corners more rounded and a bit of a drop shadow applied on hover as well.</p>
<p><img src="http://css-tricks.com/wp-content/csstricks-uploads/growing-links.png" width="570" height="250" alt="" title="" /></p>
<pre><code class="css">.grower {
    display: block;
    margin: 0 auto;
    width: 120px;
    padding: 2px 5px;
    border: 1px solid #2f2626;

    background: rgba(237,95,0,0.3);
    -moz-transition: all 0.1s ease-in-out;
    -webkit-transition: all 0.1s ease-in-out;
    -moz-border-radius: 2px;
    -webkit-border-radius: 2px;
}
.grower:hover {
    background: rgba(237,95,0,1.0);
    border-color: rgba(237,95,0,1.0);

    -moz-transform: scale(1.2);
    -webkit-transform: scale(1.2); 

    -moz-box-shadow: 0 0 20px black;
    -webkit-box-shadow: 0 0 20px black;

    -moz-border-radius: 10px;
    -webkit-border-radius: 10px;
}</code></pre>
<p>&nbsp;</p>
<h3>Blurred Edges</h3>
<p>Using multiple shadows behind slightly transparent text can blurs the edges of text without the need of any images. A transition can fade the text out, track out the letters, and change the font size as well.</p>
<p><img src="http://css-tricks.com/wp-content/csstricks-uploads/ghostly.png" width="570" height="262" alt="" title="" /></p>
<pre><code class="css">h3 {
    height: 100px;
    font: bold 80px Helvetica, Sans-Serif;

    color: black; /* fallback */
    color: rgba(0,0,0,0.2);

    text-shadow:
        0 0 2px rgba(0,0,0,0.2),
        0 0 4px rgba(0,0,0,0.2),
        0 0 6px rgba(0,0,0,0.2);
    -webkit-transition: all 0.2s linear;
}
h3:hover {
    color: rgba(28, 28, 28, 0.2);
    opacity: 0.8;
    letter-spacing: 15px;
    font-size: 70px;
}</code></pre>
<p>&nbsp;</p>
<h3>Elliptical Rounding</h3>
<p>The poster child for progressive enhancement is border-radius. But did you know you don&#8217;t have to create perfectly circular rounded corners? We&#8217;ll create an oval here and give &#8216;er a spin just for fun (WebKit only&#8230; Mozilla has syntax for transitions but isn&#8217;t doing them yet).</p>
<p><img src="http://css-tricks.com/wp-content/csstricks-uploads/oval.png" width="570" height="250" alt="" title="" /></p>
<pre><code class="css">.oval {
    background: #fe4902;
    width: 200px;
    height: 100px;
    line-height: 100px;
    text-align: center;
    margin: 0 auto;

    /* Notice the slightly different syntax */
    -moz-border-radius: 100px / 50px;
    -webkit-border-radius: 100px 50px;

    -webkit-transition: all 0.8s linear;
    -moz-transition: all 0.8s linear;  /* non functional just yet */
}
.oval:hover {
    -webkit-transform: rotate(720deg);
}</code></pre>
<p>&nbsp;</p>
<h3>Multiple Backgrounds</h3>
<p>If more widely supported, multiple backgrounds would be amazing timesavers. Alas, we can only use them for optional subtle enhancements now, where a fallback of nothing at all is acceptable.</p>
<p><img src="http://css-tricks.com/wp-content/csstricks-uploads/multbg.png" width="570" height="411" alt="" title="" /></p>
<pre><code class="css">body {
    background:
        url(../images/top-right.png) top right fixed no-repeat,
        url(../images/top-left.png) top left fixed no-repeat,
        url(../images/bot-left.png) bottom left fixed no-repeat,
        url(../images/bot-right.png) bottom right fixed no-repeat;
    background-color: #2f2626;
}</code></pre>
<p>&nbsp;</p>
<p><a href="http://css-tricks.com/examples/QuickieCSS3Tricks/" class="button">View Demo</a> &nbsp; <a href="http://css-tricks.com/examples/QuickieCSS3Tricks.zip" class="button">Download Files</a></p>
<p>&nbsp;</p>
<div class="feedflare">
<a href="http://feeds.feedburner.com/~ff/CssTricks?a=AM-QPZGQohw:EDNJvep3KfE:yIl2AUoC8zA"><img src="http://feeds.feedburner.com/~ff/CssTricks?d=yIl2AUoC8zA" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/CssTricks?a=AM-QPZGQohw:EDNJvep3KfE:F7zBnMyn0Lo"><img src="http://feeds.feedburner.com/~ff/CssTricks?i=AM-QPZGQohw:EDNJvep3KfE:F7zBnMyn0Lo" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/CssTricks?a=AM-QPZGQohw:EDNJvep3KfE:gIN9vFwOqvQ"><img src="http://feeds.feedburner.com/~ff/CssTricks?i=AM-QPZGQohw:EDNJvep3KfE:gIN9vFwOqvQ" border="0"></img></a>
</div><img src="http://feeds.feedburner.com/~r/CssTricks/~4/AM-QPZGQohw" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://css-tricks.com/quickie-css3-tricks-with-fallbacks/feed/</wfw:commentRss>
		<slash:comments>39</slash:comments>
		<feedburner:origLink>http://css-tricks.com/quickie-css3-tricks-with-fallbacks/</feedburner:origLink></item>
		<item>
		<title>New Poll: How do you format your CSS?</title>
		<link>http://feedproxy.google.com/~r/CssTricks/~3/J5Zga83K6D4/</link>
		<comments>http://css-tricks.com/new-poll-formatting-css/#comments</comments>
		<pubDate>Wed, 04 Nov 2009 13:33:03 +0000</pubDate>
		<dc:creator>Chris Coyier</dc:creator>
				<category><![CDATA[Article]]></category>

		<guid isPermaLink="false">http://css-tricks.com/?p=4609</guid>
		<description>The poll is in the sidebar, so jump down there to vote. You can see examples of the different ways to format CSS here.  I think that covers most of the popular ways to format CSS, but if you have your own unique way, feel free to post some code or a link to [...]</description>
			<content:encoded><![CDATA[<p>The poll is in the sidebar, so jump down there to vote. You can see examples of the <a href="http://css-tricks.com/different-ways-to-format-css/">different ways to format CSS here</a>.  I think that covers most of the popular ways to format CSS, but if you have your own unique way, feel free to post some code or a link to an example CSS file in the comments!</p>
<p><span id="more-4609"></span></p>
<p>I think it&#8217;s an interesting topic because us all the implications it may have on a site and the working life of the front end coder. We spend so much time in CSS that how we choose to format it affects how efficiently we can write it, how easily re-acquainted we are with old CSS, and even potentially page loading times assuming you don&#8217;t compress your CSS.</p>
<div class="feedflare">
<a href="http://feeds.feedburner.com/~ff/CssTricks?a=J5Zga83K6D4:JwtjCs401-o:yIl2AUoC8zA"><img src="http://feeds.feedburner.com/~ff/CssTricks?d=yIl2AUoC8zA" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/CssTricks?a=J5Zga83K6D4:JwtjCs401-o:F7zBnMyn0Lo"><img src="http://feeds.feedburner.com/~ff/CssTricks?i=J5Zga83K6D4:JwtjCs401-o:F7zBnMyn0Lo" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/CssTricks?a=J5Zga83K6D4:JwtjCs401-o:gIN9vFwOqvQ"><img src="http://feeds.feedburner.com/~ff/CssTricks?i=J5Zga83K6D4:JwtjCs401-o:gIN9vFwOqvQ" border="0"></img></a>
</div><img src="http://feeds.feedburner.com/~r/CssTricks/~4/J5Zga83K6D4" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://css-tricks.com/new-poll-formatting-css/feed/</wfw:commentRss>
		<slash:comments>112</slash:comments>
		<feedburner:origLink>http://css-tricks.com/new-poll-formatting-css/</feedburner:origLink></item>
		<item>
		<title>Poll Results: When Do Jobs Get Done?</title>
		<link>http://feedproxy.google.com/~r/CssTricks/~3/hpoatW95wIg/</link>
		<comments>http://css-tricks.com/poll-results-when-do-jobs-get-done/#comments</comments>
		<pubDate>Tue, 03 Nov 2009 19:00:49 +0000</pubDate>
		<dc:creator>Chris Coyier</dc:creator>
				<category><![CDATA[Article]]></category>

		<guid isPermaLink="false">http://css-tricks.com/?p=4600</guid>
		<description>When this poll first kicked off, the &amp;#8220;late&amp;#8221; options were way ahead. Over time, things have evened off a bit, and the results are closer than I thought they might be. 


If you are in the on time or early crowd, congrats! That means you are really good at estimating project completion times. For the [...]</description>
			<content:encoded><![CDATA[<p>When this poll first kicked off, the &#8220;late&#8221; options were way ahead. Over time, things have evened off a bit, and the results are closer than I thought they might be. </p>
<p><img src="http://css-tricks.com/wp-content/csstricks-uploads/early-or-late-graph.png" width="570" height="300" alt="" title="" /></p>
<p><span id="more-4600"></span></p>
<p>If you are in the on time or early crowd, congrats! That means you are really good at estimating project completion times. For the rest of us, that means we should start pushing those dates back a little further than we do now. Of course, meeting deadlines is reliant upon both our working speed <strong>and</strong> our clients ability to communicate, but we are the ones issuing the completion dates, so it&#8217;s our job to anticipate these things. And you know what they say, under-promise and over-deliver.</p>
<p>New poll later this week.</p>
<div class="feedflare">
<a href="http://feeds.feedburner.com/~ff/CssTricks?a=hpoatW95wIg:SifX2QlPYt0:yIl2AUoC8zA"><img src="http://feeds.feedburner.com/~ff/CssTricks?d=yIl2AUoC8zA" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/CssTricks?a=hpoatW95wIg:SifX2QlPYt0:F7zBnMyn0Lo"><img src="http://feeds.feedburner.com/~ff/CssTricks?i=hpoatW95wIg:SifX2QlPYt0:F7zBnMyn0Lo" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/CssTricks?a=hpoatW95wIg:SifX2QlPYt0:gIN9vFwOqvQ"><img src="http://feeds.feedburner.com/~ff/CssTricks?i=hpoatW95wIg:SifX2QlPYt0:gIN9vFwOqvQ" border="0"></img></a>
</div><img src="http://feeds.feedburner.com/~r/CssTricks/~4/hpoatW95wIg" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://css-tricks.com/poll-results-when-do-jobs-get-done/feed/</wfw:commentRss>
		<slash:comments>10</slash:comments>
		<feedburner:origLink>http://css-tricks.com/poll-results-when-do-jobs-get-done/</feedburner:origLink></item>
		<item>
		<title>Holy Sprites</title>
		<link>http://feedproxy.google.com/~r/CssTricks/~3/ADkSsBKaem8/</link>
		<comments>http://css-tricks.com/holy-sprites/#comments</comments>
		<pubDate>Mon, 02 Nov 2009 11:39:46 +0000</pubDate>
		<dc:creator>Chris Coyier</dc:creator>
				<category><![CDATA[Article]]></category>

		<guid isPermaLink="false">http://css-tricks.com/?p=4586</guid>
		<description>Lots of folks joined in on the fun with the Show Off Your Sprites! contest. I used the ol&amp;#8217; random number generator and came up with Lee Kowalkowski as the big winner, congrats Lee! Now let&amp;#8217;s take a look at some of the submissions. Looking at sprites I find strangely fascinating. It&amp;#8217;s like this strange [...]</description>
			<content:encoded><![CDATA[<p>Lots of folks joined in on the fun with the <a href="http://css-tricks.com/sprites-contest/">Show Off Your Sprites!</a> contest. I used the ol&#8217; <a href="http://css-tricks.com/generate-a-random-number/">random number generator</a> and came up with Lee Kowalkowski as the big winner, congrats Lee! Now let&#8217;s take a look at some of the submissions. Looking at sprites I find strangely fascinating. It&#8217;s like this strange secret language of the web that only us performance nerds really understand =)</p>
<p><span id="more-4586"></span></p>
<p>Some of these may have been cropped or resized. They aren&#8217;t meant to be taken and used, I just hope they serve as an inspirational spark!</p>
<p><img src="http://css-tricks.com/wp-content/csstricks-uploads/sprite-1.png" width="382" height="196" alt="" title="" /></p>
<p><img src="http://css-tricks.com/wp-content/csstricks-uploads/nav_logo7.png" width="164" height="106" alt="" title="" /></p>
<p><img src="http://css-tricks.com/wp-content/csstricks-uploads/dragon-sprite.jpg" width="556" height="350" alt="" title="" /></p>
<p><img src="http://css-tricks.com/wp-content/csstricks-uploads/STORMINKspriteOLD.png" width="416" height="157" alt="" title="" /></p>
<p><img src="http://css-tricks.com/wp-content/csstricks-uploads/apple-sprite.png" width="558" height="152" alt="" title="" /></p>
<p><img src="http://css-tricks.com/wp-content/csstricks-uploads/socialbuttons.png" width="432" height="72" alt="" title="" /></p>
<p><img src="http://css-tricks.com/wp-content/csstricks-uploads/jquery-ui.png" width="256" height="240" alt="" title="" /></p>
<p><img src="http://css-tricks.com/wp-content/csstricks-uploads/yahoo-cn.png" width="557" height="270" alt="" title="" /></p>
<p><img src="http://css-tricks.com/wp-content/csstricks-uploads/amazon.png" width="410" height="307" alt="" title="" /></p>
<p><img src="http://css-tricks.com/wp-content/csstricks-uploads/cycle-news.png" width="528" height="378" alt="" title="" /></p>
<p><img src="http://css-tricks.com/wp-content/csstricks-uploads/tech-icons.png" width="210" height="140" alt="" title="" /></p>
<p><img src="http://css-tricks.com/wp-content/csstricks-uploads/youtube-sprite.png" width="169" height="468" alt="" title="" /></p>
<p><img src="http://css-tricks.com/wp-content/csstricks-uploads/warsprite.png" width="549" height="335" alt="" title="" /></p>
<p><img src="http://css-tricks.com/wp-content/csstricks-uploads/makesometime.png" width="370" height="304" alt="" title="" /></p>
<p><img src="http://css-tricks.com/wp-content/csstricks-uploads/rachel.png" width="391" height="414" alt="" title="" /></p>
<p><img src="http://css-tricks.com/wp-content/csstricks-uploads/tut9sprite2.jpg" width="553" height="240" alt="" title="" /></p>
<p><img src="http://css-tricks.com/wp-content/csstricks-uploads/buttons_sprite.gif" width="240" height="341" alt="" title="" /></p>
<p><img src="http://css-tricks.com/wp-content/csstricks-uploads/princespriteswb3.jpg" width="561" height="637" alt="" title="" /></p>
<p><img src="http://css-tricks.com/wp-content/csstricks-uploads/timwright.jpg" width="400" height="475" alt="" title="" /></p>
<p><img src="http://css-tricks.com/wp-content/csstricks-uploads/beersprite.jpg" width="570" height="304" alt="" title="" /></p>
<p><img src="http://css-tricks.com/wp-content/csstricks-uploads/tommyday.jpg" width="526" height="312" alt="" title="" /></p>
<p><img src="http://css-tricks.com/wp-content/csstricks-uploads/designbumb.jpg" width="553" height="641" alt="" title="" /></p>
<p><img src="http://css-tricks.com/wp-content/csstricks-uploads/social_sprite16.png" width="112" height="32" alt="" title="" /></p>
<p><img src="http://css-tricks.com/wp-content/csstricks-uploads/login-v2.png" width="175" height="300" alt="" title="" /></p>
<p><img src="http://css-tricks.com/wp-content/csstricks-uploads/bg_sprites.jpg" width="257" height="297" alt="" title="" /></p>
<p><img src="http://css-tricks.com/wp-content/csstricks-uploads/netsprite.png" width="383" height="445" alt="" title="" /></p>
<p><img src="http://css-tricks.com/wp-content/csstricks-uploads/mine-sprite.png" width="64" height="48" alt="" title="" /></p>
<p>If you just look through all these and were like &#8220;Uhmm, what the heck was that?&#8221; Those are called CSS Sprites and you can <a href="http://css-tricks.com/css-sprites/">learn about them here</a>.</p>
<div class="feedflare">
<a href="http://feeds.feedburner.com/~ff/CssTricks?a=ADkSsBKaem8:q8QWbqoTSI4:yIl2AUoC8zA"><img src="http://feeds.feedburner.com/~ff/CssTricks?d=yIl2AUoC8zA" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/CssTricks?a=ADkSsBKaem8:q8QWbqoTSI4:F7zBnMyn0Lo"><img src="http://feeds.feedburner.com/~ff/CssTricks?i=ADkSsBKaem8:q8QWbqoTSI4:F7zBnMyn0Lo" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/CssTricks?a=ADkSsBKaem8:q8QWbqoTSI4:gIN9vFwOqvQ"><img src="http://feeds.feedburner.com/~ff/CssTricks?i=ADkSsBKaem8:q8QWbqoTSI4:gIN9vFwOqvQ" border="0"></img></a>
</div><img src="http://feeds.feedburner.com/~r/CssTricks/~4/ADkSsBKaem8" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://css-tricks.com/holy-sprites/feed/</wfw:commentRss>
		<slash:comments>28</slash:comments>
		<feedburner:origLink>http://css-tricks.com/holy-sprites/</feedburner:origLink></item>
		<item>
		<title>Redesigned Personal Site</title>
		<link>http://feedproxy.google.com/~r/CssTricks/~3/PmqDMckx7yE/</link>
		<comments>http://css-tricks.com/redesigned-personal-site/#comments</comments>
		<pubDate>Fri, 30 Oct 2009 11:46:39 +0000</pubDate>
		<dc:creator>Chris Coyier</dc:creator>
				<category><![CDATA[Article]]></category>

		<guid isPermaLink="false">http://css-tricks.com/?p=4555</guid>
		<description>As I do from time to time, I redesigned my personal site (redesign notes). I wanted to make the site a better vessel for writing, so the shell of the site has a much nicer structure for doing that. It&amp;#8217;s 100% WordPress of course. I did break one major rule: the design is a complete [...]</description>
			<content:encoded><![CDATA[<p>As I do from time to time, I <a href="http://chriscoyier.net/">redesigned my personal site</a> <a href="http://chriscoyier.net/2009/10/22/redesign/">(redesign notes)</a>. I wanted to make the site a better vessel for writing, so the shell of the site has a much nicer structure for doing that. It&#8217;s 100% WordPress of course. I did break one major rule: the design is a complete overhaul of the previous site, rather than an evolutionary step. I just felt like evolution wasn&#8217;t going to cut it this time. And besides, this is a low-traffic, personal site, not major news portal or web app or anything where the &#8220;Who moved my cheese?&#8221; phenomenon is much stronger.</p>
<p><span id="more-4555"></span></p>
<p>In typical web design, a generic template is used for articles. Images may be dropped in, but by and large, each article follows the same structure. If you are familiar with WordPress, think of the single.php file, which serves as the template for all blog post articles on the whole site. There may be nothing wrong with that for a lot of sites. This site is like that, by and large.</p>
<p>Of course all of you have heard of Jason Santa Maria and <a href="http://jasonsantamaria.com/">his website</a>. Jason&#8217;s idea is that web design doesn&#8217;t have to be like that (even CMS driven sites). He says that web design can learn a lot from print design, in the care and craft that goes into publishing content in that media (e.g. a magazine). Articles throughout a magazine may have similar characteristics, but each one will have also have design choices that suit the content it is serving. Perhaps large graphics, text wrapping around images, multiple columns, different colors and title styles, could be anything. </p>
<p>The idea is coming to be known as &#8216;Art directing on the web&#8217;. Jason is a great example, but check out <a href="http://dustincurtis.com/">Dustin Curtis</a> as well.  This isn&#8217;t just a fad, it&#8217;s just good, timeless design. I&#8217;m going to try and get on board myself with the new blog. Not every single thing I write will be a complete transformation, and some may have none at all. I like my base template just fine and it will accommodate quick writings just fine. But when I have the time an inclination, this new site will be a fun base to build around. </p>
<p>Here are some recent posts I&#8217;ve played with a bit.</p>
<h4>List of Post Apocalyptic Movies</h4>
<p><a href="http://chriscoyier.net/2009/10/25/list-of-post-apocalyptic-movies/"><img src="http://css-tricks.com/wp-content/csstricks-uploads/cc-apoc.jpg" width="570" height="342" alt="" title="" /></a></p>
<h4>Grooveshark on the iPhone</h4>
<p><a href="http://chriscoyier.net/2009/10/26/grooveshark-on-the-iphone/"><img src="http://css-tricks.com/wp-content/csstricks-uploads/cc-groove.jpg" width="570" height="707" alt="" title="" /></a></p>
<h4>10 years of Simutronics</h4>
<p><a href="http://chriscoyier.net/2009/10/29/10-years-of-simutronics/"><img src="http://css-tricks.com/wp-content/csstricks-uploads/cc-simu.jpg" width="570" height="1802" alt="" title="" /></a></p>
<h3>So how is it done?</h3>
<p>Well if you aren&#8217;t using a CMS, it&#8217;s easy, just design away. If you are using a CMS, there is already a template in place which you means you need to &#8220;fight&#8221; against the existing CSS. I&#8217;m using WordPress, and I think the easiest way to accomplish it on that platform is through the <a href="http://wordpress.org/extend/plugins/art-direction/">art direction plugin</a>. </p>
<p>This plugin adds a box to the post editor with two fields. One for code to insert on any page the post appears, and the other for code to insert only when the page is viewed in it&#8217;s single form. </p>
<p><img src="http://css-tricks.com/wp-content/csstricks-uploads/art-direct.jpg" width="570" height="313" alt="" title="" /></p>
<p>With that code dropped into the right box, that code is now inserted into the &lt;head&gt; of the page when it&#8217;s loaded.</p>
<p><img src="http://css-tricks.com/wp-content/csstricks-uploads/code-inserted.png" width="544" height="189" alt="" title="" /></p>
<p>Because this comes after the CSS file, identical selectors are overwritten by these. No fancy !important stuff needed. Important to note here, is that whatever goes in these boxes gets inserted. It doesn&#8217;t have to be a &lt;style&gt; block. It could be a link to an external CSS file (preferable if what you are doing gets complex). It could be JavaScript as well.</p>
<p>I&#8217;m just starting to get the hang of this. None of the above examples is any crazy major transformation, but I think enough was done to make each of them interesting and serves the content a little better. My plan for the future is to make a set of CSS files that I can use as a base for a post alterations as needed. For example, a &#8220;white.css&#8221;, that I can load in to replace the sites dark background with a light background. This will involve changing that background color, but also flip flopping colors on lots of different text to make it dark-on-light, as well as stuff like my name/logo up top. Then if I have a post that will make more sense to be on white (because of imagery, for example), I&#8217;ll duplicate that stylesheet and use it as a base for alterations. Fun fun!</p>
<p>&nbsp;</p>
<p>Oh, and Happy Halloween!</p>
<div class="feedflare">
<a href="http://feeds.feedburner.com/~ff/CssTricks?a=PmqDMckx7yE:VJkuvqaNybk:yIl2AUoC8zA"><img src="http://feeds.feedburner.com/~ff/CssTricks?d=yIl2AUoC8zA" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/CssTricks?a=PmqDMckx7yE:VJkuvqaNybk:F7zBnMyn0Lo"><img src="http://feeds.feedburner.com/~ff/CssTricks?i=PmqDMckx7yE:VJkuvqaNybk:F7zBnMyn0Lo" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/CssTricks?a=PmqDMckx7yE:VJkuvqaNybk:gIN9vFwOqvQ"><img src="http://feeds.feedburner.com/~ff/CssTricks?i=PmqDMckx7yE:VJkuvqaNybk:gIN9vFwOqvQ" border="0"></img></a>
</div><img src="http://feeds.feedburner.com/~r/CssTricks/~4/PmqDMckx7yE" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://css-tricks.com/redesigned-personal-site/feed/</wfw:commentRss>
		<slash:comments>31</slash:comments>
		<feedburner:origLink>http://css-tricks.com/redesigned-personal-site/</feedburner:origLink></item>
		<item>
		<title>New Screencast: How Not To Design a Checkout</title>
		<link>http://feedproxy.google.com/~r/CssTricks/~3/nOUi6oeiN3Q/</link>
		<comments>http://css-tricks.com/new-screencast/#comments</comments>
		<pubDate>Thu, 29 Oct 2009 12:40:23 +0000</pubDate>
		<dc:creator>Chris Coyier</dc:creator>
				<category><![CDATA[Article]]></category>

		<guid isPermaLink="false">http://css-tricks.com/?p=4518</guid>
		<description>You&amp;#8217;ll have to forgive me here folks, this isn&amp;#8217;t a very constructive screencast. I was frustrated at the crappy checkout process for a software product I was trying, so I thought I&amp;#8217;d screencast it as a lesson to us all on how not to design a checkout. It was confusing, frustrating, error-prone, and make me [...]</description>
			<content:encoded><![CDATA[<blockquote><p>You&#8217;ll have to forgive me here folks, this isn&#8217;t a very constructive screencast. I was frustrated at the crappy checkout process for a software product I was trying, so I thought I&#8217;d screencast it as a lesson to us all on how not to design a checkout. It was confusing, frustrating, error-prone, and make me feel unsafe about even going through with the transaction. If you are designing a site to sell something online, nothing is more important to your success than the checkout process and it deserves to be made as simple and pleasurable as possible.</p></blockquote>
<p><a href="http://css-tricks.com/video-screencasts/75-how-not-to-design-a-checkout/"><img src="http://css-tricks.com/wp-content/csstricks-uploads/screencast-75-thumb.jpg" width="249" height="154" alt="" title="" /></a></p>
<div class="feedflare">
<a href="http://feeds.feedburner.com/~ff/CssTricks?a=nOUi6oeiN3Q:yogMYq9rKo8:yIl2AUoC8zA"><img src="http://feeds.feedburner.com/~ff/CssTricks?d=yIl2AUoC8zA" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/CssTricks?a=nOUi6oeiN3Q:yogMYq9rKo8:F7zBnMyn0Lo"><img src="http://feeds.feedburner.com/~ff/CssTricks?i=nOUi6oeiN3Q:yogMYq9rKo8:F7zBnMyn0Lo" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/CssTricks?a=nOUi6oeiN3Q:yogMYq9rKo8:gIN9vFwOqvQ"><img src="http://feeds.feedburner.com/~ff/CssTricks?i=nOUi6oeiN3Q:yogMYq9rKo8:gIN9vFwOqvQ" border="0"></img></a>
</div><img src="http://feeds.feedburner.com/~r/CssTricks/~4/nOUi6oeiN3Q" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://css-tricks.com/new-screencast/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		<feedburner:origLink>http://css-tricks.com/new-screencast/</feedburner:origLink></item>
		<item>
		<title>Images on a Subdomain (?)</title>
		<link>http://feedproxy.google.com/~r/CssTricks/~3/L-XtAhqU23o/</link>
		<comments>http://css-tricks.com/images-on-a-subdomain/#comments</comments>
		<pubDate>Wed, 28 Oct 2009 11:43:41 +0000</pubDate>
		<dc:creator>Chris Coyier</dc:creator>
				<category><![CDATA[Article]]></category>

		<guid isPermaLink="false">http://css-tricks.com/?p=4511</guid>
		<description>I can&amp;#8217;t remember where, but a while ago I read something about using subdomains to serve up a sites resources as a way to potentially speed up loading. The theory was that the protocol that browsers use to communicate with servers only allows some limited number of things to be download concurrently from a single [...]</description>
			<content:encoded><![CDATA[<p>I can&#8217;t remember where, but a while ago I read something about using subdomains to serve up a sites resources as a way to potentially speed up loading. The theory was that the protocol that browsers use to communicate with servers only allows some limited number of things to be download concurrently from a single domain (like 2 or 4?). But a site fairly commonly has dozens of resources. So if you were to create a subdomain (e.g. images.css-tricks.com) and use that to serve up images, that would be treated as a different domain and you would double the number of concurrent downloads possible.</p>
<p><span id="more-4511"></span></p>
<p>In trying to research it, I haven&#8217;t been able to turn up a lot of quality information. Some forum threads are condemning it saying that multiple DNS lookups would then be required slowing things down more than speeding things up. Others going to far as to say that Google may penalize for this (which seems relatively absurd).</p>
<p>I&#8217;m always trying to improve the efficiency and speed of my sites where I can. This past weekend I was trying to improve my CSS Sprites use on this site. This was <a href="http://images.css-tricks.com/theme-4/css-tricks.png">the result</a>. It is fairly trivial to create a subdomain, so I tossed it up on there. This is just one image so it doubt it will make any big difference, but I&#8217;ll definitely look into moving all of the images from the theme onto a subdomain if there is any conclusive evidence this is a smart idea.</p>
<p>Anyone have any good information on this?</p>
<div class="feedflare">
<a href="http://feeds.feedburner.com/~ff/CssTricks?a=L-XtAhqU23o:5U1RkgZja6s:yIl2AUoC8zA"><img src="http://feeds.feedburner.com/~ff/CssTricks?d=yIl2AUoC8zA" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/CssTricks?a=L-XtAhqU23o:5U1RkgZja6s:F7zBnMyn0Lo"><img src="http://feeds.feedburner.com/~ff/CssTricks?i=L-XtAhqU23o:5U1RkgZja6s:F7zBnMyn0Lo" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/CssTricks?a=L-XtAhqU23o:5U1RkgZja6s:gIN9vFwOqvQ"><img src="http://feeds.feedburner.com/~ff/CssTricks?i=L-XtAhqU23o:5U1RkgZja6s:gIN9vFwOqvQ" border="0"></img></a>
</div><img src="http://feeds.feedburner.com/~r/CssTricks/~4/L-XtAhqU23o" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://css-tricks.com/images-on-a-subdomain/feed/</wfw:commentRss>
		<slash:comments>75</slash:comments>
		<feedburner:origLink>http://css-tricks.com/images-on-a-subdomain/</feedburner:origLink></item>
		<item>
		<title>Organic Tabs</title>
		<link>http://feedproxy.google.com/~r/CssTricks/~3/LBen62ipPKs/</link>
		<comments>http://css-tricks.com/organic-tabs/#comments</comments>
		<pubDate>Tue, 27 Oct 2009 12:48:34 +0000</pubDate>
		<dc:creator>Chris Coyier</dc:creator>
				<category><![CDATA[Article]]></category>

		<guid isPermaLink="false">http://css-tricks.com/?p=4530</guid>
		<description>Have you ever seen a tabbed content area in a sidebar that was a little &amp;#8220;jerky&amp;#8221;?  The jerkiness can be caused by a bunch of things, like the content in the tabbed areas are of different heights, or maybe the way the switch happens the current one is hidden for a brief second before [...]</description>
			<content:encoded><![CDATA[<p>Have you ever seen a tabbed content area in a sidebar that was a little &#8220;jerky&#8221;?  The jerkiness can be caused by a bunch of things, like the content in the tabbed areas are of different heights, or maybe the way the switch happens the current one is hidden for a brief second before the new one shows up and the content below it jumps up and back down quickly. For lack of a better term, I&#8217;m calling tabs that behave more smoothly <em>organic</em> tabs .</p>
<p><span id="more-4530"></span></p>
<p><embed src="http://blip.tv/play/hMAsgaqEQwA" type="application/x-shockwave-flash" width="570" height="428" allowscriptaccess="always" allowfullscreen="true"></embed></p>
<p><a href="http://css-tricks.com/examples/OrganicTabs/" class="button">View Demo</a> &nbsp; <a href="http://css-tricks.com/examples/OrganicTabs.zip" class="button">Download Files</a></p>
<p>&nbsp;</p>
<h3>The Plan</h3>
<p>The plan is to build a tabbed area, something pretty simple to do from scratch with jQuery, and then make it behave better. Of course, we&#8217;ll keep it simple, and keep the markup clean and semantic. The guts of the functionality will be based on calculating heights and animating between those heights on the fly.</p>
<p><img src="http://css-tricks.com/wp-content/csstricks-uploads/organictabs.jpg" width="570" height="250" alt="" title="" /></p>
<h3>The HTML</h3>
<p>We have a wrapper, then one unordered list for the tabs themselves. These tabs have rel attributes equal to the ID&#8217;s of the unordered lists below that they relate to. The content is the unordered lists inside the &#8216;all-list-wrap&#8221; div container. That&#8217;s the key here, the content wrapper.</p>
<pre><code class="html">&lt;div id="organic-tabs"&gt;

   &lt;ul id="explore-nav"&gt;
      &lt;li id="ex-featured"&gt;&lt;a rel="featured" href="#" class="current"&gt;Featured&lt;/a&gt;&lt;/li&gt;
      &lt;li id="ex-core"&gt;&lt;a rel="core" href="#"&gt;Core&lt;/a&gt;&lt;/li&gt;
      &lt;li id="ex-jquery"&gt;&lt;a rel="jquerytuts" href="#"&gt;jQuery&lt;/a&gt;&lt;/li&gt;
      &lt;li id="ex-classics" class="last"&gt;&lt;a rel="classics" href="#"&gt;Classics&lt;/a&gt;&lt;/li&gt;
   &lt;/ul&gt;

   &lt;div id="all-list-wrap"&gt;

      &lt;ul id="featured"&gt;
         &lt;li&gt;&lt;a href="#"&gt;Full Page Background Images&lt;/a&gt;&lt;/li&gt;
         &lt;li&gt;&lt;a href="#"&gt;Designing for WordPress&lt;/a&gt;&lt;/li&gt;
         &lt;!-- More... --&gt;
      &lt;/ul&gt;

      &lt;ul id="core"&gt;
         &lt;li&gt;&lt;a href="#"&gt;The VERY Basics of HTML &amp;amp; CSS&lt;/a&gt;&lt;/li&gt;
         &lt;li&gt;&lt;a href="#"&gt;Classes and IDs&lt;/a&gt;&lt;/li&gt;
         &lt;!-- More... --&gt;
      &lt;/ul&gt;

      &lt;ul id="jquerytuts"&gt;
         &lt;li&gt;&lt;a href="#"&gt;Anything Slider jQuery Plugin&lt;/a&gt;&lt;/li&gt;
         &lt;li&gt;&lt;a href="#"&gt;Moving Boxes&lt;/a&gt;&lt;/li&gt;
         &lt;!-- More... --&gt;
      &lt;/ul&gt;

      &lt;ul id="classics"&gt;
         &lt;li&gt;&lt;a href="#"&gt;Top Designers CSS Wishlist&lt;/a&gt;&lt;/li&gt;
         &lt;li&gt;&lt;a href="#"&gt;What Beautiful HTML Code Looks Like&lt;/a&gt;&lt;/li&gt;
         &lt;!-- More... --&gt;
      &lt;/ul&gt;

   &lt;/div&gt; &lt;!-- END List Wrap --&gt;

 &lt;/div&gt; &lt;!-- END Organic Tabs --&gt;</code></pre>
<p>The CSS</p>
<p>There isn&#8217;t much trickery here, just setting things up the look right.</p>
<pre><code class="css">ul { list-style: none; }
ul li a { display: block; border-bottom: 1px solid #666; padding: 4px; color: #666; }
ul li a:hover { background: #fe4902; color: white; }
ul li:last-child a { border: none; }

#organic-tabs { background: #eee; padding: 10px; margin: 0 0 15px 0; -moz-box-shadow: 0 0 5px #666; -webkit-box-shadow: 0 0 5px #666; }

#explore-nav { overflow: hidden; margin: 0 0 10px 0; }
#explore-nav li { width: 97px; float: left; margin: 0 10px 0 0; }
#explore-nav li.last { margin-right: 0; }
#explore-nav li a { display: block; padding: 5px; background: #959290; color: white; font-size: 10px; text-align: center; border: 0; }
#explore-nav li a:hover { background-color: #111; }

#jquerytuts, #core, #classics { display: none; }

#explore-nav li#ex-featured a.current, ul#featured li a:hover { background-color: #0575f4; color: white; }
#explore-nav li#ex-core a.current, ul#core li a:hover { background-color: #d30000; color: white; }
#explore-nav li#ex-jquery a.current, ul#jquerytuts li a:hover { background-color: #8d01b0; color: white; }
#explore-nav li#ex-classics a.current, ul#classics li a:hover { background-color: #FE4902; color: white; }</code></pre>
<p>Few things possibly of interest. First, I&#8217;ve been liking this style of CSS formatting lately. Just single line format with single spacing between everything. No fancy tabbing. I realized recently I can read this just fine, I can write it faster, and not waste time formatting CSS to look pretty when this reads just as well. Second, there are a couple of tricks in here I use pretty frequently. The .last selector removes right margin on the tabs, so I can get that right tab flush right. The :last-child selector removes the border from the bottom list items, so we can get lines between each link but not before the first item or after the last. </p>
<h3>The jQuery</h3>
<p>The plan in plain English:</p>
<ol>
<li>Set the outer wrapper to a set height of the current content</li>
<li>When a tab is clicked&#8230;</li>
<li>Setting highlighting of tab to correct tab</li>
<li>Fade out current content</li>
<li>Fade in current content</li>
<li>Animate height of outer wrapper to height of new content</li>
</ol>
<pre><code class="javascript">$(function() {

    $("#explore-nav li a").click(function() {

        // Figure out current list via CSS class
        var curList = $("#explore-nav li a.current").attr("rel");

        // List moving to
        var $newList = $(this);

        // Set outer wrapper height to height of current inner list
        var curListHeight = $("#all-list-wrap").height();
        $("#all-list-wrap").height(curListHeight);

        // Remove highlighting - Add to just-clicked tab
        $("#explore-nav li a").removeClass("current");
        $newList.addClass("current");

        // Figure out ID of new list
        var listID = $newList.attr("rel");

        if (listID != curList) {

            // Fade out current list
            $("#"+curList).fadeOut(300, function() {

                // Fade in new list on callback
                $("#"+listID).fadeIn();

                // Adjust outer wrapper to fit new list snuggly
                var newHeight = $("#"+listID).height();
                $("#all-list-wrap").animate({
                    height: newHeight
                });

            });

        }        

        // Don't behave like a regular link
        return false;
    });

});</code></pre>
<p>The code is commented up to hopefully explain things line by line. Normally we would never set the height on an outer wrapper of content. It&#8217;s kinda bad form, because content can change and height needs to be flexible to accommodate. But because we are calculating height dynamically each time anything happens with this list, we are somewhat safe. That is really the key here. Because the outer wrapper doesn&#8217;t change width until all the content swapping is done, the list adjusts very organically.</p>
<p>Enjoy!</p>
<p>&nbsp;</p>
<p><a href="http://css-tricks.com/examples/OrganicTabs/" class="button">View Demo</a> &nbsp; <a href="http://css-tricks.com/examples/OrganicTabs.zip" class="button">Download Files</a></p>
<p>&nbsp;</p>
<div class="feedflare">
<a href="http://feeds.feedburner.com/~ff/CssTricks?a=LBen62ipPKs:bToMYrHU_HY:yIl2AUoC8zA"><img src="http://feeds.feedburner.com/~ff/CssTricks?d=yIl2AUoC8zA" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/CssTricks?a=LBen62ipPKs:bToMYrHU_HY:F7zBnMyn0Lo"><img src="http://feeds.feedburner.com/~ff/CssTricks?i=LBen62ipPKs:bToMYrHU_HY:F7zBnMyn0Lo" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/CssTricks?a=LBen62ipPKs:bToMYrHU_HY:gIN9vFwOqvQ"><img src="http://feeds.feedburner.com/~ff/CssTricks?i=LBen62ipPKs:bToMYrHU_HY:gIN9vFwOqvQ" border="0"></img></a>
</div><img src="http://feeds.feedburner.com/~r/CssTricks/~4/LBen62ipPKs" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://css-tricks.com/organic-tabs/feed/</wfw:commentRss>
		<slash:comments>44</slash:comments>
		<feedburner:origLink>http://css-tricks.com/organic-tabs/</feedburner:origLink></item>
		<item>
		<title>Show Off Your Sprites!</title>
		<link>http://feedproxy.google.com/~r/CssTricks/~3/EWf5rPdoZB0/</link>
		<comments>http://css-tricks.com/sprites-contest/#comments</comments>
		<pubDate>Mon, 26 Oct 2009 12:13:17 +0000</pubDate>
		<dc:creator>Chris Coyier</dc:creator>
				<category><![CDATA[Article]]></category>

		<guid isPermaLink="false">http://css-tricks.com/?p=4523</guid>
		<description>I just updated my old CSS Sprites article yesterday, and I thought it would be kind of fun to ask everyone to share sprites that they have created themselves. Let&amp;#8217;s make a quick giveaway out of it too!

 I&amp;#8217;ve finished my copy of Dan Cederholm&amp;#8217;s Handcrafted CSS, which was very good. My copy is now [...]</description>
			<content:encoded><![CDATA[<p>I just updated my old <a href="http://css-tricks.com/css-sprites/">CSS Sprites</a> article yesterday, and I thought it would be kind of fun to ask everyone to share sprites that they have created themselves. Let&#8217;s make a quick giveaway out of it too!</p>
<p><span id="more-4523"></span></p>
<p><img src="http://css-tricks.com/wp-content/csstricks-uploads/cover-dvd.png" style="float: left; margin: 0 20px 10px 0;" /> I&#8217;ve finished my copy of Dan Cederholm&#8217;s <a href="http://handcraftedcss.com/">Handcrafted CSS</a>, which was very good. My copy is now of course slightly used, but I figured why not pass it on to someone else who can learn from it. It&#8217;s the version that comes with the DVD video as well. I&#8217;ll choose one random person to send it to.</p>
<div style="clear: both;"></div>
<p><strong>To enter,</strong> just leave a link in the comments below directly linking to your sprite image. If you have never created a sprite, find an interesting one on the web and link directly to that. Make sure to leave your real email when commenting so I can contact you if you win. I&#8217;ll select a winner next week.</p>
<p>If you are thinking you are going to try and find a sprite elsewhere, but don&#8217;t know how, I&#8217;d suggest using <a href="http://getfirebug.com/">Firebug</a>. Pop it open and mouse around things on the site, trying to find things that use background images. Hover over the URL path to the background image and see if there is more than meets the eye going on. This is one of <a href="http://images.css-tricks.com/theme-4/css-tricks.png">mine</a> looks like in Firebug:</p>
<p><img src="http://css-tricks.com/wp-content/csstricks-uploads/sprite-finding.jpg" width="570" height="377" alt="" title="" /></p>
<div class="feedflare">
<a href="http://feeds.feedburner.com/~ff/CssTricks?a=EWf5rPdoZB0:KdJ1-Wv8w3g:yIl2AUoC8zA"><img src="http://feeds.feedburner.com/~ff/CssTricks?d=yIl2AUoC8zA" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/CssTricks?a=EWf5rPdoZB0:KdJ1-Wv8w3g:F7zBnMyn0Lo"><img src="http://feeds.feedburner.com/~ff/CssTricks?i=EWf5rPdoZB0:KdJ1-Wv8w3g:F7zBnMyn0Lo" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/CssTricks?a=EWf5rPdoZB0:KdJ1-Wv8w3g:gIN9vFwOqvQ"><img src="http://feeds.feedburner.com/~ff/CssTricks?i=EWf5rPdoZB0:KdJ1-Wv8w3g:gIN9vFwOqvQ" border="0"></img></a>
</div><img src="http://feeds.feedburner.com/~r/CssTricks/~4/EWf5rPdoZB0" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://css-tricks.com/sprites-contest/feed/</wfw:commentRss>
		<slash:comments>196</slash:comments>
		<feedburner:origLink>http://css-tricks.com/sprites-contest/</feedburner:origLink></item>
		<item>
		<title>CSS Sprites: What They Are, Why They’re Cool, and How To Use Them</title>
		<link>http://feedproxy.google.com/~r/CssTricks/~3/JBvNy8R5Rmw/</link>
		<comments>http://css-tricks.com/css-sprites/#comments</comments>
		<pubDate>Sat, 24 Oct 2009 16:41:00 +0000</pubDate>
		<dc:creator>Chris Coyier</dc:creator>
				<category><![CDATA[Article]]></category>

		<guid isPermaLink="false">http://css-tricks.com/css-sprites-what-they-are-why-theyre-cool-and-how-to-use-them/</guid>
		<description>This post was originally co-authored in late 2007 by me and Volkan Görgülü, I&amp;#8217;m updating it now to improve it a bit and make it more current.
You&amp;#8217;ve heard of them, but&amp;#8230;
Do you really understand them? The name might be a little misleading, because sprites aren&amp;#8217;t little images like you might be picturing, a sprite is [...]</description>
			<content:encoded><![CDATA[<div style="background: #fff9ce; padding: 10px; margin: 0 0 15px 0; border: 1px solid #e7c886; -moz-border-radius: 5px; -webkit-border-radius: 5px;">This post was originally co-authored in late 2007 by me and Volkan Görgülü, I&#8217;m updating it now to improve it a bit and make it more current.</div>
<h3>You&#8217;ve heard of them, but&#8230;</h3>
<p>Do you really understand them? The name might be a little misleading, because sprites aren&#8217;t <strong>little</strong> images like you might be picturing, a sprite is actually <strong>one big image</strong>. Have you ever seen the CSS technique where the &#8220;on&#8221; and &#8220;off&#8221; states of a button are contained within the same image and are activated by shifting the background-position? </p>
<p><img src="http://css-tricks.com/wp-content/csstricks-uploads/simple-css-sprite.png" width="570" height="250" alt="" title="" /></p>
<p>Here is an <a href="http://css-tricks.com/wp-content/themes/CSS-Tricks-4/images/other-projects.jpg">example of that</a> on CSS-Tricks.</p>
<p><span id="more-158"></span></p>
<p>Think of CSS Sprites as an extension of that technique. The difference is that instead of just two or three images being combined into one, you can combine an <em>unlimited</em> number of images into one. The origin of the term &#8220;sprites&#8221; comes from old school computer graphics and the video game industry. The idea was that the computer could fetch a graphic into memory, and then only display parts of that image at a time, which was faster than having to continually fetch new images. The sprite was the big combined graphic. CSS Sprites is pretty much the <em>exact same theory</em>: get the image once, shift it around and only display parts of it, saves the overhead of having to fetch multiple images.</p>
<h3>Why combine all those images? Isn&#8217;t it quicker to have smaller images?</h3>
<p>Nope, it&#8217;s not. Back in the day, everybody and their brothers were &#8220;slicing&#8221; images to make pages load faster. All that technique did was fool the eye to make it look like the page was loading faster by loading bits and pieces all over at once. Each one of those images is a separate HTTP-Request, and the more of those, the less efficient your page is.</p>
<p>Let&#8217;s look at a quote from the article &#8220;<a href="http://yuiblog.com/blog/2006/11/28/performance-research-part-1/">Performance Research, Part 1: What the 80/20 Rule Tells Us about Reducing HTTP Requests</a>&#8221; by Tenni Theurer on the Yahoo! User Interface Blog.</p>
<blockquote><p>Table 1 shows popular web sites spending between 5% and 38% of the time downloading the HTML document. The other 62% to 95% of the time is spent making HTTP requests to fetch all the components in that HTML document (i.e. images, scripts, and stylesheets). The impact of having many components in the page is exacerbated by the fact that browsers download only two or four components in parallel per hostname, depending on the HTTP version of the response and the user&#8217;s browser. Our experience shows that <strong>reducing the number of HTTP requests has the biggest impact on reducing response time and is often the easiest performance improvement to make</strong>.</p></blockquote>
<table id="time-spent-table">
<caption>Table 1. Time spent loading popular web sites</caption>
<tbody>
<tr>
<td class="empty"> </td>
<th>Time Retrieving HTML</th>
<th>Time Elsewhere</th>
</tr>
<tr>
<th>Yahoo!</th>
<td>10%</td>
<td>90%</td>
</tr>
<tr>
<th>Google</th>
<td>25%</td>
<td>75%</td>
</tr>
<tr>
<th>MySpace</th>
<td>9%</td>
<td>91%</td>
</tr>
<tr>
<th>MSN</th>
<td>5%</td>
<td>95%</td>
</tr>
<tr>
<th>ebay</th>
<td>5%</td>
<td>95%</td>
</tr>
<tr>
<th>Amazon</th>
<td>38%</td>
<td>62%</td>
</tr>
<tr>
<th>YouTube</th>
<td>9%</td>
<td>91%</td>
</tr>
<tr>
<th>CNN</th>
<td>15%</td>
<td>85%</td>
</tr>
</tbody>
</table>
<p>Every single image, whether it&#8217;s an &lt;img&gt; tag or an background-image from your CSS is a separate HTTP-Request, so you can image how quickly those requests can wrack up.</p>
<h3>OK. So how is it done?</h3>
<p>I thought you would never ask. Let&#8217;s start by showing the <a href="http://css-tricks.com/examples/CSS-Sprites/Example1Before/">BEFORE example</a>. Notice in the CSS below how the anchor tag does not get a background-image, but each individual class does.</p>
<pre><code class="css">#nav li a {background:none no-repeat left center}
#nav li a.item1 {background-image:url('../img/image1.gif')}
#nav li a:hover.item1 {background-image:url('../img/image1_over.gif')}
#nav li a.item2 {background-image:url('../img/image2.gif')}
#nav li a:hover.item2 {background-image:url('../img/image2_over.gif')}
...</code></pre>
<p><img src='http://css-tricks.com/wp-content/uploads/2007/11/example1before.png' alt='example1before.png' /></p>
<p>Using CSS Sprites, we can really lighten this example up. Instead of having ten separate images for the buttons (five default states and five rollover states), we can literally combine all of them into one big long image. I won&#8217;t go into great detail about how this is done, I&#8217;ll just give you a basic walkthrough. Create a new image that is as wide as your widest image and and as tall as the combined height of all your images plus X pixels, where X is the number of images you have. Now place you images into this new image, left aligned, one on top of the other with one pixel of white space in between.</p>
<p>Now check out the <a href="http://css-tricks.com/examples/CSS-Sprites/Example1After/">AFTER example</a>. Notice in the CSS that there is a single background-image applied to the anchor element itself, and the unique classes merely shift the background position with negative Y coordinates.</p>
<pre><code class="css">#nav li a {background-image:url('../img/image_nav.gif')}
#nav li a.item1 {background-position:0px 0px}
#nav li a:hover.item1 {background-position:0px -72px}
#nav li a.item2 {background-position:0px -143px;}
#nav li a:hover.item2 {background-position:0px -215px;}
...</code></pre>
<p><img src='http://css-tricks.com/wp-content/uploads/2007/11/example1after.png' alt='example1after.png' /></p>
<p>We were able to reduce the number of HTTP-Requests by 9 and the total file size of the image(s) by 6.5 KB. That&#8217;s a pretty huge improvement for such a little example. Imagine what you could do on a full website.</p>
<p>&nbsp;</p>
<h3>Ugh. That sounds like a lot of work.</h3>
<p>Just remember what Chuck Norris once said: &#8220;All great things require great dedication.&#8221; Actually I&#8217;m not sure if he said that or not, but it&#8217;s good advice anyway. But fortunately for you, there is a web service which makes creating and implementing sprites really easy. There are actually lots of different services designed to help you making sprites easier, but I think hands down, the best one is <a href="http://spriteme.org/">SpriteMe</a>.</p>
<h3>Using SpriteMe</h3>
<p>SpriteMe is a bookmarklet. So after you&#8217;ve put it up in your bookmarks bar, just go to any website and click it. It will open up an overlay over the right side of your screen.</p>
<p><img src="http://css-tricks.com/wp-content/csstricks-uploads/spriteme-1.jpg" width="570" height="484" alt="" title="" /></p>
<p>The top white box is a list of all the background graphics on your page that it feels like could be combined into a sprite. The boxes below are graphics that probably won&#8217;t work for sprites (and it will tell you why).  If you think differently, you can drag the links in and out of their boxes. Once you have all the images to be combined in that top box, just click the <strong>&#8220;Make Sprite&#8221;</strong> button. It will combine them all into a single image (a CSS Sprite!) that you can view right there.</p>
<p><img src="http://css-tricks.com/wp-content/csstricks-uploads/spriteme-2.jpg" width="570" height="484" alt="" title="" /></p>
<p>On the current design of this site, this is a (scaled down) version of the end result.  (Or see the <a href="http://images.css-tricks.com/theme-4/css-tricks.png">real thing</a>) </p>
<p><img src="http://css-tricks.com/wp-content/csstricks-uploads/sprite-example.png" width="570" height="500" alt="" title="" /></p>
<p>Recently, SpriteMe also made it available to &#8220;export&#8221; the CSS. Click that button and you&#8217;ll see some code like this:</p>
<div style="background: #eee; padding: 10px; border: 1px solid #ccc; margin: 0 0 20px 0; font: 12px Monaco, Courier, Mono-Space;">A id=home-link<br />
{<br />
&nbsp;&nbsp;<strike>background-image: url(http://css-tricks.com/wp-content/themes/CSS-Tricks-4/images/logo.png)</strike><br />
&nbsp;&nbsp;background-image: url(http://www.jaredhirsch.com/coolrunnings/public_images/3deb155981/spriteme1.png);<br />
&nbsp;&nbsp;background-position: -10px -10px;<br />
}<br />
A<br />
{<br />
&nbsp;&nbsp;<strike>background-image: url(http://css-tricks.com/wp-content/themes/CSS-Tricks-4/images/nav.png)</strike><br />
&nbsp;&nbsp;background-image: url(http://www.jaredhirsch.com/coolrunnings/public_images/3deb155981/spriteme1.png);<br />
&nbsp;&nbsp;background-position: -10px -56px;<br />
}</div>
<p>The crossed out code is what <em>used</em> to be in your CSS, and what the replacement should be is below it.</p>
<h3>What can&#8217;t sprites do?</h3>
<p>They don&#8217;t do repeating graphics*. Sprites are for graphics that are just single blocks. Icons are a great example candidate for CSS sprites.</p>
<p><small>*OK, they kinda can do repeating, but it&#8217;s a little trickier and can only work one-dimensionally (x or y).</small></p>
<h3>Either start from the beginning with Sprites, or do it all at the end</h3>
<p>The using of sprites is a no-brainer. You should do it. But what is the workflow when creating a new design? I think you should go one of two routes. The first is to know that you are going with sprites from the get-go and built it as you go along. That means have a Photoshop file open, start from the upper left, and drop stuff in as you need it. If you have another icon (or whatever) that makes sense to put in a sprite drop it in there and resave it.</p>
<p>The other way, which perhaps makes even more sense, is to develop without thinking about sprites at all. Make everything separate individual graphics. Then when the site is &#8220;complete&#8221; (or at least, ready for release, we all know sites are never &#8220;complete&#8221;), then use SpriteMe and do the spriting then.</p>
<h3>Other Examples</h3>
<p>Just food for thought&#8230;</p>
<h4>Ask.com</h4>
<p><img src="http://css-tricks.com/wp-content/csstricks-uploads/ask-sprite.png" width="570" height="100" alt="" title="" /></p>
<h4>Google Reader icons</h4>
<p><img src="http://css-tricks.com/wp-content/csstricks-uploads/1454282699-lhn-sprite.png" width="96" height="96" alt="" title="" /></p>
<h4>Facebook</h4>
<p><img src="http://css-tricks.com/wp-content/csstricks-uploads/facebook-sprite.png" width="570" height="296" alt="" title="" /></p>
<h3>Further Reading</h3>
<ul>
<li><a href="http://www.alistapart.com/articles/sprites">A List Apart on the case back in 2004</a></li>
<li><a href="http://www.smashingmagazine.com/2009/04/27/the-mystery-of-css-sprites-techniques-tools-and-tutorials/">Smashing Magazine</a> has lots of examples and links to other services.</li>
<p>CSS-Tricks Screencast: <a href="http://css-tricks.com/video-screencasts/43-how-to-use-css-sprites/">How to Use CSS Sprites</a>
</ul>
<div class="feedflare">
<a href="http://feeds.feedburner.com/~ff/CssTricks?a=JBvNy8R5Rmw:mFEWWQfg8iE:yIl2AUoC8zA"><img src="http://feeds.feedburner.com/~ff/CssTricks?d=yIl2AUoC8zA" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/CssTricks?a=JBvNy8R5Rmw:mFEWWQfg8iE:F7zBnMyn0Lo"><img src="http://feeds.feedburner.com/~ff/CssTricks?i=JBvNy8R5Rmw:mFEWWQfg8iE:F7zBnMyn0Lo" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/CssTricks?a=JBvNy8R5Rmw:mFEWWQfg8iE:gIN9vFwOqvQ"><img src="http://feeds.feedburner.com/~ff/CssTricks?i=JBvNy8R5Rmw:mFEWWQfg8iE:gIN9vFwOqvQ" border="0"></img></a>
</div><img src="http://feeds.feedburner.com/~r/CssTricks/~4/JBvNy8R5Rmw" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://css-tricks.com/css-sprites/feed/</wfw:commentRss>
		<slash:comments>221</slash:comments>
		<feedburner:origLink>http://css-tricks.com/css-sprites/</feedburner:origLink></item>
	</channel>
</rss>
