<?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>ghettocooler.net - It&#039;s like Facebook and Twitter, but without all the fuss. &#187; code</title>
	<atom:link href="http://ghettocooler.net/category/code/feed/" rel="self" type="application/rss+xml" />
	<link>http://ghettocooler.net</link>
	<description></description>
	<lastBuildDate>Thu, 29 Jul 2010 11:41:48 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.0</generator>
		<item>
		<title>css2-font-face</title>
		<link>http://ghettocooler.net/2010/03/16/css2-font-face/</link>
		<comments>http://ghettocooler.net/2010/03/16/css2-font-face/#comments</comments>
		<pubDate>Tue, 16 Mar 2010 10:47:31 +0000</pubDate>
		<dc:creator>Bill Keller</dc:creator>
				<category><![CDATA[code]]></category>
		<category><![CDATA[design]]></category>
		<category><![CDATA[interweb]]></category>
		<category><![CDATA[link]]></category>
		<category><![CDATA[tech]]></category>

		<guid isPermaLink="false">http://ghettocooler.net/?p=2099</guid>
		<description><![CDATA[Font Squirrel appears to be a great font generator that will create the various formats needed for the cross-browser use of @font-face. Some colleagues and I have recently been waxing poetically on the legality of using purchased fonts using this CSS2 based method of font embedding. Especially when deployed for clients, in a commercial environment. [...]]]></description>
			<content:encoded><![CDATA[<p><a href="http://www.nateduval.com/"><img src="http://ghettocooler.net/img/2010/03/nate_duval.jpg" alt="Nate Duval" title="Nate Duval" width="540" height="180" class="alignnone size-full wp-image-2100" /></a></p>
<p><a href="http://www.fontsquirrel.com/fontface/generator">Font Squirrel</a> appears to be a great font generator that will create the various formats needed for the cross-browser use of @font-face. Some colleagues and I have recently been waxing poetically on the legality of using purchased fonts using this <a href="http://www.alistapart.com/articles/cssatten">CSS2 based method of font embedding</a>. Especially when deployed for clients, in a commercial environment. While @font-face is a bit overdue to go mainstream (A List Apart was touting it as the next big thing in 2007), now that the browsers are coming of age, the tipping point is near. It will dominate other options that are currently bridging the gap, like <a href="http://typekit.com">http://typekit.com</a>. However, we have come to the conclusion that now is the time to pay more attention to a fonts use policy. Some will explicitly forbid the designer/developer from exposing the font file online. Some will encourage it, and I assume,many more will not mention it. This means web shops should start gathering and using libraries filled with the fonts that encourage the use of @font-face. Here&#8217;s where I&#8217;m starting. As linked in the previous ALA article: <a href="http://moorstation.org/typoasis/designers/steffmann/index.htm">Dieter Steffmann</a> offers up a slew of freely usable fonts and I&#8217;m sure several more lists like this, <a href="http://blog.themeforest.net/tutorials/css-font-face-and-15-free-fonts-you-can-use-today/">@font-face and 15 Free Fonts You Can Use Today</a>, exist.</p>
<p>Here&#8217;s a <a href="http://www.alistapart.com/comments/cssatten/P100/#107">great explanation of the licensing issue we&#8217;re facing with @font-face</a>:</p>
<blockquote><p>&#8230;foundries don’t actually claim copyright in the typefaces themselves. Instead they claim copyright on the .ttf file (or whatever) as a piece of software. Then, when you buy the right to use the software, they make you click “Agree” to an EULA which prohibits you from uploading the file to your website. If you want your users to see your font over the web, then you need to send them that file, and the EULA says you can’t.
</p></blockquote>
]]></content:encoded>
			<wfw:commentRss>http://ghettocooler.net/2010/03/16/css2-font-face/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>The stolen series</title>
		<link>http://ghettocooler.net/2009/10/06/the-stolen-series/</link>
		<comments>http://ghettocooler.net/2009/10/06/the-stolen-series/#comments</comments>
		<pubDate>Tue, 06 Oct 2009 14:07:27 +0000</pubDate>
		<dc:creator>Bill Keller</dc:creator>
				<category><![CDATA[code]]></category>
		<category><![CDATA[design]]></category>
		<category><![CDATA[interweb]]></category>

		<guid isPermaLink="false">http://ghettocooler.net/?p=1733</guid>
		<description><![CDATA[Today&#8217;s update comes from me spending lots of time on Things Magazine. I love the site and their approach to discussing, pointing out, shouting about, whispering quietly amongst themselves, today&#8217;s potentially cluttered online culture. Sometimes they expound, sometimes they don&#8217;t. It&#8217;s art with some noise, noise with some meaning or even none at all. So [...]]]></description>
			<content:encoded><![CDATA[<p><a href="http://www.booooooom.com/2009/10/05/ssin-artist-painting-drawing/"><img src="http://ghettocooler.net/img/2009/10/first_post.jpg" alt="first_post" title="first_post" width="540" height="181" class="alignright size-full wp-image-1738" /></a><br />
Today&#8217;s update comes from me spending lots of time on <a href="http://thingsmagazine.net">Things Magazine</a>. I love the site and their approach to discussing, pointing out, shouting about, whispering quietly amongst themselves, today&#8217;s potentially cluttered online culture. Sometimes they expound, sometimes they don&#8217;t. It&#8217;s art with some noise, noise with some meaning or even none at all. So I&#8217;ve borrowed heavily. It&#8217;s one of the few sites I leave <a href="http://google.com/reader/">Google Reader</a> to read. Jammed in among popular noise makers, few sites demand such attention. There&#8217;s a couple of random patterns in use with these updated styles, the newest from <a href="http://www.patternfoundry.com/swatch.html?all_patterns=yes">Pattern Foundry</a> and a <a href="http://www.flickr.com/photos/soupenvy/2519265897/in/set-72157605238224051/">squiggly lines pattern</a> of my own creation which has stuck around.</p>
]]></content:encoded>
			<wfw:commentRss>http://ghettocooler.net/2009/10/06/the-stolen-series/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>etnies ecommerce</title>
		<link>http://ghettocooler.net/2009/04/03/etnies-ecommerce/</link>
		<comments>http://ghettocooler.net/2009/04/03/etnies-ecommerce/#comments</comments>
		<pubDate>Fri, 03 Apr 2009 11:04:39 +0000</pubDate>
		<dc:creator>Bill Keller</dc:creator>
				<category><![CDATA[california]]></category>
		<category><![CDATA[code]]></category>
		<category><![CDATA[design]]></category>
		<category><![CDATA[interweb]]></category>
		<category><![CDATA[skateboarding]]></category>

		<guid isPermaLink="false">http://ghettocooler.net/?p=1471</guid>
		<description><![CDATA[etnies shop What a novel idea, sell your own shoes online! In these tough economic times did Sole Technology stop messing around with overpriced under performing outsourced ecommerce and finally bring it all under their own umbrella? It looks that way, congrats web dept, nice work!]]></description>
			<content:encoded><![CDATA[<p><a href="http://etnies.com/shop/twitch/black-charcoal/"><img src="http://ghettocooler.net/img/2009/04/shoes1.png" alt="shop etnies" title="shop etnies" width="500" height="321" /></a></p>
<div class="delicious-link"><a href="http://etnies.com/shop/twitch/black-charcoal/">etnies shop</a></div>
<p>What a novel idea, sell your own shoes online! In these tough economic times did Sole Technology stop messing around with overpriced under performing outsourced ecommerce and <em>finally</em> bring it all under their own umbrella?</p>
<p><a href="http://etnies.com/shop/mens/footwear/shoes/">It looks that way</a>, congrats web dept, nice work!</p>
]]></content:encoded>
			<wfw:commentRss>http://ghettocooler.net/2009/04/03/etnies-ecommerce/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>BBColors Color Schemes</title>
		<link>http://ghettocooler.net/2009/01/31/bbcolors-color-schemes/</link>
		<comments>http://ghettocooler.net/2009/01/31/bbcolors-color-schemes/#comments</comments>
		<pubDate>Sat, 31 Jan 2009 17:14:46 +0000</pubDate>
		<dc:creator>Bill Keller</dc:creator>
				<category><![CDATA[code]]></category>
		<category><![CDATA[interweb]]></category>
		<category><![CDATA[original]]></category>
		<category><![CDATA[tech]]></category>

		<guid isPermaLink="false">http://ghettocooler.net/?p=1251</guid>
		<description><![CDATA[U23D, Gentle Honey, Zen and Tea, available as bbcolors color schemes (.zip) Awhile back Daring Fireball created BBColors, a &#8220;free command-line tool for saving and loading text color preference schemes for BBEdit and TextWrangler&#8221;. I&#8217;ve been using it ever since, switching between the available color shemes. A color refresh for your code rejuvinates the soul. [...]]]></description>
			<content:encoded><![CDATA[<p><img src="http://ghettocooler.net/img/2009/01/bbcolors-color-schemes2.png" alt="bbcolors-color-schemes" title="bbcolors-color-schemes" width="420" height="397" class="alignnone size-full wp-image-1262" /></p>
<p><span id="more-1251"></span></p>
<p><strong>U23D, Gentle Honey, Zen and Tea, available as <a href="http://ghettocooler.net/stuff/bbcolors/bbcolors-color-schemes.zip">bbcolors color schemes</a> (.zip)</strong></p>
<p>Awhile back Daring Fireball created <a href="http://daringfireball.net/projects/bbcolors/">BBColors</a>, a &#8220;free command-line tool for saving and loading text color preference schemes for BBEdit and TextWrangler&#8221;. I&#8217;ve been using it ever since, switching between the available color shemes. A color refresh for your code rejuvinates the soul.</p>
<p>Occasionally I&#8217;ll search the web for new color schemes available for download but have yet to find any, so I created a couple based on color sets from <a href="http://kuler.adobe.com/">kuler.adobe.com</a>, they&#8217;re available for download in <a href="http://ghettocooler.net/stuff/bbcolors/bbcolors-color-schemes.zip">bbcolors-color-schemes.zip</a>. I hope other BBColor fans will find them a nice addition to their collection.</p>
<p>The .zip file contains 3 color themes based on the following Adobe Kuler color sets:</p>
<ul>
<li><a href="http://kuler.adobe.com/#themeID/336060">U23D</a></li>
<li><a href="http://kuler.adobe.com/#themeID/335244">Gentle Honey</a></li>
<li><a href="http://kuler.adobe.com/#themeID/337112">Zen and Tea</a></li>
</ul>
<p>Daring Fireball has <a href="'http://daringfireball.net/projects/bbcolors/">instructions on installing and using BBColors</a>. But here&#8217;s the jist on getting these new color schemes up and running:</p>
<ol class="code">
<li><code>Install <a href="http://daringfireball.net/projects/bbcolors/">BBColors</a></code></li>
<li><code>unpack <a href="http://ghettocooler.net/stuff/bbcolors/bbcolors-color-schemes.zip">bbcolors-color-schemes.zip</a></code></li>
<li><code>type "bbcolors -open" in your command line, revealing the location of saved color schemes</code></li>
<li><code>Drag and drop your new color schemes into the aforementioned directory</code></li>
<li><code>type bbcolors -load "Name of Theme"</code></li>
</ol>
]]></content:encoded>
			<wfw:commentRss>http://ghettocooler.net/2009/01/31/bbcolors-color-schemes/feed/</wfw:commentRss>
		<slash:comments>9</slash:comments>
		</item>
		<item>
		<title>Add To My Google Calendar</title>
		<link>http://ghettocooler.net/2008/03/28/add-to-my-google-calendar/</link>
		<comments>http://ghettocooler.net/2008/03/28/add-to-my-google-calendar/#comments</comments>
		<pubDate>Fri, 28 Mar 2008 16:00:35 +0000</pubDate>
		<dc:creator>Bill Keller</dc:creator>
				<category><![CDATA[code]]></category>
		<category><![CDATA[design]]></category>
		<category><![CDATA[interweb]]></category>

		<guid isPermaLink="false">http://08.ghettocooler.net/?p=892</guid>
		<description><![CDATA[I recently had to schedule some blood work for a physical and was blown away to find an &#8220;Add To My Google Calendar&#8221; button on the confirmation page. I could barely contain my excitement in anticipation of what data would be passed along to Google Calendar. I called Susan over to share in the user [...]]]></description>
			<content:encoded><![CDATA[<p>I recently had to schedule some blood work for a physical and was blown away to find an &#8220;Add To My Google Calendar&#8221; button on the confirmation page.<br />
<span id="more-892"></span><br />
<a rel="lightbox" href="http://ghettocooler.net/img/gcal-nice.png"><img src="http://ghettocooler.net/img/_gcal-nice.png" width="250" height="148" alt="Gcal" title="Gcal"  /></a></p>
<p>I could barely contain my excitement in anticipation of what data would be passed along to Google Calendar. I called Susan over to share in the user experience unfurling before me. If this was going to get ugly, I could not face it alone.</p>
<p>Thankfully, we were not disappointed.</p>
<p><a rel="lightbox" href="http://ghettocooler.net/img/gcal-nice2.png"><img src="http://ghettocooler.net/img/_gcal-nice2.png" width="250" height="128" alt="gcal" title="gcal"  /></a></p>
<p>Highlights Include:</p>
<ul>
<li>Pre-populated end time. Now I know this should take about 15 minutes.</li>
<li>Pre-popluated address. One click away from google maps.</li>
<li>Relevant info in the description field.</li>
</ul>
]]></content:encoded>
			<wfw:commentRss>http://ghettocooler.net/2008/03/28/add-to-my-google-calendar/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Internet Explorer 8 &#8220;activities&#8221;</title>
		<link>http://ghettocooler.net/2008/03/05/internet-explorer-8-activities/</link>
		<comments>http://ghettocooler.net/2008/03/05/internet-explorer-8-activities/#comments</comments>
		<pubDate>Wed, 05 Mar 2008 20:32:03 +0000</pubDate>
		<dc:creator>Bill Keller</dc:creator>
				<category><![CDATA[code]]></category>
		<category><![CDATA[interweb]]></category>
		<category><![CDATA[link]]></category>
		<category><![CDATA[tech]]></category>

		<guid isPermaLink="false">http://ghettocooler.net/2008/03/05/internet-explorer-8-activities/</guid>
		<description><![CDATA[Activities: Microsoft&#8217;s version of microformats? They&#8217;re awfully similar &#038; require no work for the developer. The downside? HTML documents will continue to lack the rich markup that microformats offer. We can continue using microformats to mark up our documents of course, but I wonder if this will stagnate their growth.]]></description>
			<content:encoded><![CDATA[<p><a href="http://www.microsoft.com/windows/products/winfamily/ie/ie8/readiness/DevelopersNew.htm">Activities</a>: Microsoft&#8217;s version of microformats? They&#8217;re awfully similar &#038; require no work for the developer. The downside? HTML documents will continue to lack the rich markup that <a href="http://microformats.org/">microformats</a> offer. We can continue using microformats to mark up our documents of course, but I wonder if this will stagnate their growth.</p>
]]></content:encoded>
			<wfw:commentRss>http://ghettocooler.net/2008/03/05/internet-explorer-8-activities/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>SWFObject, External Interface, Internet Explorer</title>
		<link>http://ghettocooler.net/2008/02/27/swfobject-external-interface-internet-explorer/</link>
		<comments>http://ghettocooler.net/2008/02/27/swfobject-external-interface-internet-explorer/#comments</comments>
		<pubDate>Wed, 27 Feb 2008 18:05:01 +0000</pubDate>
		<dc:creator>Bill Keller</dc:creator>
				<category><![CDATA[code]]></category>
		<category><![CDATA[interweb]]></category>
		<category><![CDATA[tech]]></category>

		<guid isPermaLink="false">http://ghettocooler.net/2008/02/27/swfobject-external-interface-internet-explorer/</guid>
		<description><![CDATA[Just a tip. If you&#8217;re ever using SWFObject to write out your flash files and ExternalInterface to communicate with them, in Internet Explorer (6 &#38; 7), make sure that the ID of your embedded flash file is all lowercase. Take this basic code for example, used to mute the audio in a flash file from [...]]]></description>
			<content:encoded><![CDATA[<p>Just a tip. If you&#8217;re ever using SWFObject to write out your flash files and ExternalInterface to communicate with them, in Internet Explorer (6 &amp; 7), make sure that the ID of your embedded flash file is <strong>all lowercase</strong>.</p>
<p>Take this basic code for example, used to mute the audio in a flash file from within HTML:<br />
<span id="more-887"></span></p>
<ol class="code">
<li><code>function audioOff() {</code></li>
<li class="tab-minor"><code>thisMovie("foobar").audioOff();</code></li>
<li><code>}</code></li>
<li><code>var so = new SWFObject("movie.swf", "foobar", "10", "10", "8", "#ffffff");</code></li>
</ol>
<p>Let&#8217;s pretend for a minute that the ID of your flash file (foobar) was mixed case:</p>
<ol class="code">
<li><code>function audioOff() {</code></li>
<li class="tab-minor"><code>thisMovie("fooBar").audioOff();</code></li>
<li><code>}</code></li>
<li><code>var so = new SWFObject("movie.swf", "fooBar", "10", "10", "8", "#ffffff");</code></li>
</ol>
<p><strong>When your ID is mixed case it fails in Internet Explorer.</strong></p>
<p>Note: Using hyphens in your ID&#8217;s (foo-bar) will also fail. The hyphen fail is well documented on the web, so I certainly should have paid more attention to the use of mixed case. It&#8217;s always the simple things that take 3 days to figure out.</p>
]]></content:encoded>
			<wfw:commentRss>http://ghettocooler.net/2008/02/27/swfobject-external-interface-internet-explorer/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>jQuery Tool Tips, For &amp; By a Javascript Noob</title>
		<link>http://ghettocooler.net/2007/12/18/jquery-tool-tips-for-by-a-javascript-noob/</link>
		<comments>http://ghettocooler.net/2007/12/18/jquery-tool-tips-for-by-a-javascript-noob/#comments</comments>
		<pubDate>Wed, 19 Dec 2007 03:03:12 +0000</pubDate>
		<dc:creator>Bill Keller</dc:creator>
				<category><![CDATA[code]]></category>
		<category><![CDATA[interweb]]></category>

		<guid isPermaLink="false">http://ghettocooler.net/2007/12/18/jquery-tool-tips-for-by-a-javascript-noob/</guid>
		<description><![CDATA[I&#8217;ve recently been using, and falling in love with, a Javascript library you&#8217;ve probably heard of &#8211; jQuery. So when I needed Tool Tip functionality for a project, the one thing I was sure about was that jQuery was the way to go. I tried writing some things myself and didn&#8217;t like the results. Then [...]]]></description>
			<content:encoded><![CDATA[<p>I&#8217;ve recently been using, and falling in love with, a Javascript library you&#8217;ve probably heard of &#8211; <a href="http://jquery.com">jQuery</a>. So when I needed Tool Tip functionality for a project, the one thing I was sure about was that jQuery was the way to go. I tried writing some things myself and didn&#8217;t like the results. Then I tried a couple of different jQuery based <a href="http://plugins.learningjquery.com/cluetip/">Tool</a> Tip <a href="http://www.codylindley.com/blogstuff/js/jtip/">plugins</a>, which worked OK, but I knew they were cumbersome &amp; supurfulous. </p>
<p><span id="more-883"></span></p>
<p>I planned on coming back &amp; giving them another go myself, all I needed was a little motivation. Apple&#8217;s <a href="http://www.apple.com/finalcutstudio/">Final Cut Studio 2</a> site (found via <a href="http://del.icio.us/jodyferry/">Jody Ferry&#8217;s delicious</a> links) provided just the amount of motivation I needed. Comparatively mine looks like ass, but you get the idea.</p>
<p><strong>Screenshot of the Tool Tip in action:</strong><br />(view the <a href="http://ghettocooler.net/stuff/code/jquery/tool-tips/">live example</a>)<br />
<a href="http://ghettocooler.net/stuff/code/jquery/tool-tips/"><img style="border: 1px solid #333;margin-top:4px;" src="http://ghettocooler.net/img/jquery-tool-tip.png" width="354" height="235" alt="jQuery Tool Tip" title="jQuery tool tip" /></a></p>
<p>So from one Javascript noob to another <a href="http://ghettocooler.net/stuff/code/jquery/tool-tips/">Tool Tips using jQuery</a> are so easy, it&#8217;ll knock your socks off! </p>
<p>If you haven&#8217;t already, you should also dive into the <a href="http://docs.jquery.com/Tutorials">jQuery tutorials</a>, you&#8217;ll never consider one of those inferior Javascript libraries again.</p>
<p><strong>Update:</strong> In all my jQuery excitement, I overlooked the fact that if you didn&#8217;t want your Tool Tips to animate, there&#8217;s no need for any Javascript at all! I added some commented out CSS in the <a href="http://ghettocooler.net/stuff/code/jquery/tool-tips/">live example</a>, should you prefer the non-Javascript route.</p>
]]></content:encoded>
			<wfw:commentRss>http://ghettocooler.net/2007/12/18/jquery-tool-tips-for-by-a-javascript-noob/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>Simple Navigation with CSS Image Replacement</title>
		<link>http://ghettocooler.net/2007/05/31/simple-navigation-with-css-image-replacement/</link>
		<comments>http://ghettocooler.net/2007/05/31/simple-navigation-with-css-image-replacement/#comments</comments>
		<pubDate>Fri, 01 Jun 2007 05:28:19 +0000</pubDate>
		<dc:creator>Bill Keller</dc:creator>
				<category><![CDATA[code]]></category>
		<category><![CDATA[interweb]]></category>

		<guid isPermaLink="false">http://ghettocooler.net/2007/05/31/simple-navigation-with-css-image-replacement/</guid>
		<description><![CDATA[No silly javascript, no crazy coding, no waiting for images to load. Just some good old fashioned HTML, CSS, and a single image. Once you do this, you&#8217;ll never make your web site navigation any other way. Warning: If you aren&#8217;t into front-end coding for the web, you may want to skip this. For those [...]]]></description>
			<content:encoded><![CDATA[<p>No silly javascript, no crazy coding, no waiting for images to load. Just some good old fashioned HTML, CSS, and a <a href="http://ghettocooler.net/stuff/code/image-replaced-navigation/brand-nav.png">single image</a>.  Once you do this, you&#8217;ll never make your web site navigation any other way. </p>
<p><strong>Warning:</strong> If you aren&#8217;t into front-end coding for the web, you may want to skip this. For those that are (I love you that much more), this has been covered elsewhere and covered much better, so hopefully this is old hat.</p>
<p><span id="more-827"></span></p>
<p>Can&#8217;t wait for the results? Here&#8217;s the final <a href="http://ghettocooler.net/stuff/code/image-replaced-navigation/">navigation with CSS image replacement</a>, used in the real world. Please, disable styles, view source.</p>
<p><strong>How to do it</strong><br />
First, you should already be in the habit of making your navigation using unordered lists. If you&#8217;re not doing it, now is the time to start. </p>
<p><strong>Setup your navigation in an unordered list:</strong></p>
<ol class="code">
<li><code>&lt;ul&gt;</code></li>
<li><code>&nbsp;&nbsp; &lt;li&gt;&lt;a href="#"&gt;Navigation item 1&lt;/a&gt;&lt;/li&gt;</code></li>
<li><code>&nbsp;&nbsp; &lt;li&gt;&lt;a href="#"&gt;Navigation item 2&lt;/a&gt;&lt;/li&gt;</code></li>
<li><code>&lt;/ul&gt;</code></li>
</ol>
<p><strong>Next, add a little CSS to control your list items:</strong></p>
<ol class="code">
<li><code>ul li {</code></li>
<li><code>&nbsp;&nbsp; display:block;</code></li>
<li><code>&nbsp;&nbsp; float:left;</code></li>
<li><code>&nbsp;&nbsp; list-style-type:none;</code></li>
<li><code>&nbsp;&nbsp; }</code></li>
</ol>
<p><strong>Such basic CSS results in:</strong></p>
<ul>
<li style="display:block;float:left;"><a href="#">Navigation item 1</a></li>
<li style="display:block;float:left;"><a href="#">Navigation item 2</a></li>
</ul>
<div style="clear:both;"></div>
<p>With a few margin and font adjustments, you could stop here and you&#8217;d have yourself a nice clean navigation. But only nerds (and search engines) like such bland, basic, HTML navigation. We&#8217;re here to please our designers and clients. So Let&#8217;s turn this basic HTML into something so sexy they&#8217;ll shed tears at first sight. Something that will look like this:</p>
<p><img src="http://ghettocooler.net/img/navigation-example.png" width="157" height="100" alt="navigation example" title="navigation example" /></p>
<p>&#8220;Oh, and can you make it kind of POP on hover?&#8221; </p>
<p>Why yes; in fact we can.</p>
<p>Make yourself an image that contains both the :link state and :hover state of all your navigation items. Better yet, teach your graphic designer to do this for you. In the example below, the :link states are on top and their :hover directly below. Both areas must be the same height. </p>
<p><strong>Here&#8217;s what the image looks like, with some guides:</strong></p>
<p><img src="http://ghettocooler.net/img/navigation-psd.png" width="217" height="174" alt="navigation PSD" title="navigation PSD" /></p>
<p>You&#8217;ll then export that file and use it as a background-image for all of the links in your unordered list. Here&#8217;s where your guides come in handy. In this example, the link area has a height of 66 pixels and the first list item is 34 pixels wide, so we&#8217;ll setup some CSS defaults for the anchor tags:</p>
<ol class="code">
<li><code>ul li a {</code></li>
<li><code>&nbsp;&nbsp; display:block;</code></li>
<li><code>&nbsp;&nbsp; height:66px; width:34px;</code></li>
<li><code>&nbsp;&nbsp; background:transparent url(navigation.png) no-repeat 0 0;</code></li>
<li><code>&nbsp;&nbsp; text-indent:-9009px;</code></li>
<li><code>&nbsp;&nbsp; }</code></li>
</ol>
<p>You&#8217;ll notice the text-indent:-9009px; That pulls the text out of sight and out of mind. Make way for your pixel princess!</p>
<p>My second list item is wider, so let&#8217;s give that one an ID and change the width. We also need to pull the background-image 34 pixels to the left, since that&#8217;s where the image for the second list item starts.</p>
<ol class="code">
<li><code>&lt;ul&gt;</code></li>
<li><code>&nbsp;&nbsp; &lt;li&gt;&lt;a href="#"&gt;Navigation item 1&lt;/a&gt;&lt;/li&gt;</code></li>
<li><code>&nbsp;&nbsp; &lt;li id="navigation2"&gt;&lt;a href="#"&gt;Navigation item 2&lt;/a&gt;&lt;/li&gt;</code></li>
<li><code>&lt;/ul&gt;</code></li>
<li>&nbsp;</li>
<li><code>ul li#navigation2 a {</code></li>
<li><code>&nbsp;&nbsp; width:60px;</code></li>
<li><code>&nbsp;&nbsp; background-position: -34px 0;</code></li>
<li><code>&nbsp;&nbsp; }</code></li>
</ol>
<p><strong>Now our regular old HTML unordered list is starting to get somewhere:</strong></p>
<p><img src="http://ghettocooler.net/img/navigation-raw.png" width="94" height="66" alt="navigation raw" title="navigation raw" /></p>
<p><strong>Now for the :hover &#038; the real magic</strong></p>
<p>All that&#8217;s left is to move the background-image on :hover. Since our list items have a height of 66 pixels, we&#8217;ll move the background-image up 66 pixels for each list item:</p>
<ol class="code">
<li><code>ul li a:hover {</code></li>
<li><code>&nbsp;&nbsp; background-position: 0 -66px;</code></li>
<li><code>&nbsp;&nbsp; }</code></li>
<li>&nbsp;</li>
<li><code>ul li#navigation2 a:hover {</code></li>
<li><code>&nbsp;&nbsp; background-position: -34px -66px;</code></li>
<li><code>&nbsp;&nbsp; }</code></li>
</ol>
<p><strong>You&#8217;ll now have the start of one sweet ass, simple navigation:</strong></p>
<style type="text/css">ul#brand-nav li {display:block;float:left;list-style-type:none;}ul#brand-nav li a {display:block;height:66px;width:34px;background:transparent url(http://ghettocooler.net/img/navigation-final.png) no-repeat 0 0;text-indent:-9009px;}ul#brand-nav li#navigation2 a {width:60px;background-position: -34px 0;}ul#brand-nav li a:hover {border:none ! important;background-position: 0 -66px;}ul#brand-nav li#navigation2 a:hover {background-position: -34px -66px;}</style>
<ul id="brand-nav">
<li><a href="#">Navigation item 1</a></li>
<li id="navigation2" ><a href="#">Navigation item 2</a></li>
</ul>
<div style="clear:both;"></div>
<p>Throw some margins in there for spacing, or add whatever tweaks you deem necessary. The final step is to laugh at how simple this is, and never look back.</p>
<p>Carry this same process throughout the rest of your navigation and you&#8217;ll end up with something so search engine friendly you&#8217;ll now be crying along with your client. </p>
<p>Here&#8217;s the final <a href="http://ghettocooler.net/stuff/code/image-replaced-navigation/">navigation with CSS image replacement</a>, used in the real world. Please, disable styles, view source. If you look carefully, you&#8217;ll notice that once the client asks you to change the order of the list items, it&#8217;s as simple as moving around your LI&#8217;s in the HTML into any order you&#8217;d like.</p>
<p>If you have improvements, ways to make this more efficient, or you&#8217;d just like to share how long you&#8217;ve been using this technique for and how old it is; Please, leave your comments.</p>
<p><strong>Update:</strong><br />
To get your hover state to stay in the hover state, to mark the users currently selected page for example, I like to use an ID or class on the body tag.</p>
<p>For example, on a contact page add:</p>
<ol class="code">
<li><code>&lt;body id="contact"&gt;</code></li>
</ol>
<p>And in your CSS hover state, add a line for body#contact:</p>
<ol class="code">
<li><code>ul li a:hover,</code></li>
<li><code>body#contact ul li a {</code></li>
<li><code>&nbsp;&nbsp; background-position: 0 -66px;</code></li>
<li><code>&nbsp;&nbsp; }</code></li>
</ol>
<p><strong>Did you find this post helpful?</strong><br />
<script type="text/javascript"><!--
google_ad_client = "pub-1277501307276052";
google_ad_slot = "5904257483";
google_ad_width = 468;
google_ad_height = 60;
//--></script>
<script type="text/javascript" src="http://pagead2.googlesyndication.com/pagead/show_ads.js"></script>
</p>
]]></content:encoded>
			<wfw:commentRss>http://ghettocooler.net/2007/05/31/simple-navigation-with-css-image-replacement/feed/</wfw:commentRss>
		<slash:comments>54</slash:comments>
		</item>
		<item>
		<title>Replace Your Logo! CSS Image Replacement</title>
		<link>http://ghettocooler.net/2006/12/07/replace-your-logo-css-image-replacement/</link>
		<comments>http://ghettocooler.net/2006/12/07/replace-your-logo-css-image-replacement/#comments</comments>
		<pubDate>Thu, 07 Dec 2006 14:32:03 +0000</pubDate>
		<dc:creator>Bill Keller</dc:creator>
				<category><![CDATA[code]]></category>
		<category><![CDATA[interweb]]></category>

		<guid isPermaLink="false">http://ghettocooler.net/2006/12/07/replace-your-logo-css-image-replacement/</guid>
		<description><![CDATA[This technique has been around for so long, but still too many people are not using it. It&#8217;s one of the easiest first steps you need to take toward making your site semantically correct and search engine friendly (see the final result in action). Never, ever, put a company logo as a straight up image [...]]]></description>
			<content:encoded><![CDATA[<p>This technique has been around for so long, but still too many people are not using it.  It&#8217;s one of the easiest first steps you need to take toward making your site semantically correct and search engine friendly (<a href="http://ghettocooler.net/stuff/code/image-replace/">see the final result in action</a>).</p>
<p>Never, ever, put a company logo as a straight up image in HTML.  It needs to be recognized by Google and if it&#8217;s just an image sitting in your code, no one can find it.  </p>
<p>Let Google know your logo is an important item on your site by dropping it in an &lt;h1&gt;&lt;/h1&gt;.  Then let Google read and index your company name by using <strong>real text</strong>, not an image:</p>
<p>The HTML for your logo should look like this:</p>
<ol class="code">
<li><code>&lt;h1&gt;My Company&lt;/h1&gt;</code></li>
</ol>
<p>Now use some CSS to replace your text with an image (Use the width &#038; height of your own image):</p>
<ol class="code">
<li><code>* {margin: 0;padding: 0;}</code></li>
<li><code>h1 {</code></li>
<li class="tab1"><code>display: block;</code></li>
<li class="tab1"><code>width: 250px;</code></li>
<li class="tab1"><code>height: 46px;</code></li>
<li class="tab1"><code>text-indent: -9999px;</code></li>
<li class="tab1"><code>background: transparent url(my-company.jpg) no-repeat 0 0;</code></li>
<li class="tab1"><code>}</code></li>
</ol>
<p>Usually you&#8217;ll be linking your logo to your home page too, which is just as easy to accomplish:</p>
<p>The HTML:</p>
<ol class="code">
<li><code>&lt;h1&gt;&lt;a href="/" title="My Company"&gt;My Company&lt;/a&gt;&lt;/h1&gt;</code></li>
</ol>
<p>And the CSS for your anchor tag:</p>
<ol class="code">
<li><code>h1 a {</code></li>
<li class="tab1"><code>display: block;</code></li>
<li class="tab1"><code>width: 100%;</code></li>
<li class="tab1"><code>height: 100%;</code></li>
<li class="tab1"><code>outline: none;</code></li>
<li class="tab1"><code>}</code></li>
</ol>
<p>It&#8217;s as simple as that!  Go edit your logo&#8217;s HTML.</p>
<p><a href="http://ghettocooler.net/stuff/code/image-replace/">See the final result in action</a>, disable CSS styles to see it through google&#8217;s eyes. View source, copy &#038; paste.</p>
<p><strong>Update:</strong> For even more search engine love, be more descriptive in your H1:</p>
<ol class="code">
<li><code>&lt;h1&gt;My Company - My Companies Main Goal&lt;/h1&gt;</code></li>
</ol>
<p>Or, use any HTML element you deem most appropriate.</p>
<p><strong>Did you find this post helpful?</strong></p>
<p><script type="text/javascript"><!--
google_ad_client = "pub-1277501307276052";
google_ad_slot = "5904257483";
google_ad_width = 468;
google_ad_height = 60;
//--></script>
<script type="text/javascript" src="http://pagead2.googlesyndication.com/pagead/show_ads.js"></script>
</p>
]]></content:encoded>
			<wfw:commentRss>http://ghettocooler.net/2006/12/07/replace-your-logo-css-image-replacement/feed/</wfw:commentRss>
		<slash:comments>23</slash:comments>
		</item>
	</channel>
</rss>
