<?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>Jasongraphix &#187; CSS</title>
	<atom:link href="http://jasongraphix.com/journal/category/css/feed/" rel="self" type="application/rss+xml" />
	<link>http://jasongraphix.com</link>
	<description>A journal of art, thoughts, and projects by Jason Beaird.</description>
	<lastBuildDate>Sun, 29 Jan 2012 03:39:35 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3.1</generator>
		<item>
		<title>Wanna see my link bg?</title>
		<link>http://jasongraphix.com/journal/wanna-see-my-link-bg/</link>
		<comments>http://jasongraphix.com/journal/wanna-see-my-link-bg/#comments</comments>
		<pubDate>Thu, 21 Jul 2011 16:31:30 +0000</pubDate>
		<dc:creator>Jason Beaird</dc:creator>
				<category><![CDATA[CSS]]></category>

		<guid isPermaLink="false">http://jasongraphix.com/?p=1392</guid>
		<description><![CDATA[I have this sad tendency lately to reduce an announcement down to a tweet that I would have previously written a full blog post about. You know, little things like <a href="http://twitter.com/#!/jasongraphix/status/85159280734519297" rel="external">updating a Firefox extension</a> so that it actually works again. That was almost a month ago, and I was about to share a link to my little plugin this afternoon and realized that the last time I posted anything <em>here</em> about it was February...<a href="/journal/view-multiple-link-bgs/">of 2010</a>.

So yea, this blog is sorely neglected, but if you've ever wanted to right-click on a link in Firefox and see the background image of said link (or the background of it's parent element or multiple background images), I made an extension just for you...]]></description>
			<content:encoded><![CDATA[<p>I have this sad tendency lately to reduce an announcement down to a tweet that I would have previously written a full blog post about. You know, little things like <a href="http://twitter.com/#!/jasongraphix/status/85159280734519297" rel="external">updating a Firefox extension</a> so that it actually works again. That was almost a month ago, and I was about to share a link to my little plugin this afternoon and realized that the last time I posted anything <em>here</em> about it was February&#8230;<a href="/journal/view-multiple-link-bgs/">of 2010</a>. </p>
<p>So yea, this blog is sorely neglected, but if you&#8217;ve ever wanted to right-click on a link in Firefox and see the background image of said link (or the background of it&#8217;s parent element or multiple background images), I made an extension just for you. Actually, I made it for you several years ago. I just didn&#8217;t tell you. It&#8217;s called <a href="http://jasongraphix.com/downloads/linkbackimage/">View Link Background Image</a> and you should install it.</p>
<h3>User Testimonial:</h3>
<blockquote><div>&#8220;Oh my god I had no idea this was a thing. You are a golden god.&#8221; &#8211; <a href="http://twitter.com/#!/beep/status/85160606587568129" rel="external">@beep</a></div>
</blockquote>
]]></content:encoded>
			<wfw:commentRss>http://jasongraphix.com/journal/wanna-see-my-link-bg/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>In a Sixless World&#8230;</title>
		<link>http://jasongraphix.com/journal/in-a-sixless-world/</link>
		<comments>http://jasongraphix.com/journal/in-a-sixless-world/#comments</comments>
		<pubDate>Wed, 24 Mar 2010 18:20:12 +0000</pubDate>
		<dc:creator>Jason Beaird</dc:creator>
				<category><![CDATA[CSS]]></category>
		<category><![CDATA[browsers]]></category>
		<category><![CDATA[css2]]></category>
		<category><![CDATA[css3]]></category>
		<category><![CDATA[ie6]]></category>
		<category><![CDATA[support]]></category>

		<guid isPermaLink="false">http://jasongraphix.com/?p=920</guid>
		<description><![CDATA[For years I&#8217;ve been dreaming of a day when I could write HTML and CSS without the limitations of Internet Explorer 6. That dream became a reality on March 1st when I left my previous job at a web agency and started working with MailChimp. MailChimp phased out their support for IE6 over a year [...]]]></description>
			<content:encoded><![CDATA[<p>For years I&#8217;ve been dreaming of a day when I could write HTML and CSS without the limitations of Internet Explorer 6. That dream became a reality on March 1st when I left my previous job at a web agency and started working with <a rel="external" href="http://mailchimp.com/">MailChimp</a>. MailChimp phased out their support for IE6 over a year ago and has been enhancing their UI even further with a little CSS3 magic as well. While I love working with front-end code that represents the future of the web, I&#8217;m discovering just as much joy in what really should be the present.</p>
<p>With <a rel="external" href="http://ie.microsoft.com/testdrive/">IE9</a> looming over the horizon, it&#8217;s finally time to think about the great advantages to having IE7 as our new lowest common denominator. It really will change the way you work. Here&#8217;s just a few things that become possible:</p>
<ul>
<li>Warmly embrace 24-bit PNG transparency. You&#8217;ll still be able to get smaller file-sizes out of 8-bit PNGs, but you won&#8217;t have to use any shady hacks to get rid of that telltale gray background.</li>
<li>Stop adding &#8220;book end&#8221; classes to the first or last item in a list to give it a different set of styles. Instead you can use the <code>:first-child</code> or <strike><code>:last-child</code></strike> psuedo-class. <em>Nathan&#8217;s right, no <code>:last-child</code> support in IE7.</em></li>
<li>Forget about adding page slug classes for individually styled navigation items. With CSS2 attribute selectors, you can actually write styles for <code>a[href="/about/"]</code>.</li>
<li>Reliably apply multiple classes to elements. A common example would be <code>&lt;p class="alert error"&gt;Error...&lt;/p&gt;</code> Honestly though, being able to finally use <a rel="external" href="http://www.w3.org/TR/css3-selectors/#attribute-substrings">substring matching attribute selectors</a> could sidestep the need for multiple classes altogether. Instead you could write a rule for <code>p[class$="-alert"]</code> that would apply to <code>.error-alert</code>, <code>.success-alert</code>, or even <code>.rabid-antelope-alert</code>.</li>
<li>Eliminate the use of JavaScript for simple fly-out navigations. Now that the <code>:hover</code> psuedo-class works on non-link elements, you can show or hide sub-navigation when the parent list-item is hovered.</li>
<li>Finally say goodbye to <a rel="external" href="http://twitter.com/ded">@ded</a>&#8216;s <a rel="external" href="http://www.dustindiaz.com/min-height-fast-hack/">Min-Height Fast Hack</a> now that <code>min-height</code> works across the board. This also means you can use <code>max-height</code>, <code>min-width</code> and <code>max-width</code> too.</li>
</ul>
<h3>Hold Tight!</h3>
<p>While I was working at an agency that still supported IE6, it was hard not to envy those web workers who did not have to design for it. For those of you who have clients that still hold dear to this undead browser from 2001, it&#8217;s time is very, very near. There are a <a rel="external" href="http://www.ie6nomore.com/">growing number</a> of major sites and applications that no longer support IE6. What I&#8217;m most excited about though, is that fact that <a rel="external" href="http://googleenterprise.blogspot.com/2010/01/modern-browsers-for-modern-applications.html">Google has joined the movement</a>. They began phasing out their IE6 support (starting with Docs and Sites) this month, started warning YouTube users that their browser is no longer supported, and will allegedly stop supporting IE6 in GMail &#8220;<a rel="external" href="http://news.techworld.com/networking/3211924/gmail-to-drop-ie6-support-this-year/">later this year</a>&#8220;. With that kind of pressure, it won&#8217;t be long before even the slowest IT departments start allowing their users to upgrade or switch browsers.</p>
<p>So, what changes are <em>you</em> most excited about once IE6 is no more?</p>
]]></content:encoded>
			<wfw:commentRss>http://jasongraphix.com/journal/in-a-sixless-world/feed/</wfw:commentRss>
		<slash:comments>4</slash:comments>
		</item>
		<item>
		<title>Photoshop to Website</title>
		<link>http://jasongraphix.com/journal/photoshop-to-website/</link>
		<comments>http://jasongraphix.com/journal/photoshop-to-website/#comments</comments>
		<pubDate>Tue, 01 Jul 2008 20:09:41 +0000</pubDate>
		<dc:creator>Jason Beaird</dc:creator>
				<category><![CDATA[CSS]]></category>
		<category><![CDATA[feedback]]></category>
		<category><![CDATA[photoshop to html]]></category>
		<category><![CDATA[principles of beautiful web design]]></category>
		<category><![CDATA[resources]]></category>
		<category><![CDATA[webdesign]]></category>

		<guid isPermaLink="false">http://beta.jasongraphix.com/journal/photoshop-to-website/</guid>
		<description><![CDATA[
]]></description>
			<content:encoded><![CDATA[<p>It&#8217;s been over a year and a half since <a href="http://www.principlesofbeautifulwebdesign.com/" target="_blank">my book</a> hit the shelves, but I am still getting a lot of email feedback.  I&#8217;ve gotten 4 so far in the last week.  I can&#8217;t really complain because most of it is very positive, but a lot of email means a lot of time spent answering questions. While every email is different, I get three general categories of question-containing emails:</p>
<ul>
<li><strong>Personal Guidance</strong> &#8211; These types of emails usually require the most time, but are often the most rewarding to answer.  Examples include students asking what types of courses they should take and amateur webmonkeys asking what skills they need to &#8220;make it&#8221; in the industry.  I was once an amateur webmonkey, so I try to answer these when I can, even if that means they sit in my inbox for a week or two.</li>
<li><strong>Technical</strong> &#8211; Or, &#8220;how do I make this do that&#8221; emails. I try not to answer technical questions directly. I&#8217;ve learned most of what I know about website design through experience.  Instead, I try to point people to places where they can learn the answers themselves.  That leads to the last category.</li>
<li><strong>Additional Resources</strong> &#8211; The majority of questions I get are from people who simply want to know what they should learn next. I have a lot of respect for self-learners, so I do my best to <a href="http://astore.amazon.com/jasongraphix-20" target="_blank">suggest books</a> and resources that I think will help. Here is an actual example of this type of email that I received today:</li>
</ul>
<blockquote><div>
Hey Jason -</p>
<p>
I just finished reading your book and I have to say kudos for a job well done. This was probably one of the most useful web design books that I have ever read.</p>
<p>However, now that I&#8217;ve finished your book I am ready to jump right into making my (somewhat) great new comp that I&#8217;ve made in Photoshop into a web page. Yeah, that&#8217;s where I get stuck. I&#8217;ve read a couple of the &#8216;dummy&#8217; books for CSS, PHP, etc, but those don&#8217;t seem to help me take my design from the comp I&#8217;ve made in Photoshop and turn it into a functioning website. So there&#8217;s my question: can you recommend any books / sites / resources for doing just that? I understand the mechanics of CSS, for example, but I don&#8217;t know how to use it to replicate that beautiful design that is currently stuck in Photoshop onto the web.</p>
<p>Thanks in advance for any help you can offer. And again, great job!</p>
<p>John Doe
</p></div>
</blockquote>
<p>As I read this question there were several books that immediately came to mind: A few of the Sitepoint books, Designing with Web Standards, Bulletproof Web Design, Transcending CSS &#038; Web Standards Creativity. I love all of these books, and the skills &#8220;John&#8221; needs are explained well in each of them, but the process of converting a Photoshop comp to working HTML/CSS isn&#8217;t something I learned solely from a book, but rather through years of reading online resources, viewing source code and tinkering. I remembered seeing a link a few months back to a series of screencasts that supposedly did a good job of explaining this process, so I started hunting.  What I found was Chris Coyier&#8217;s <a href="http://css-tricks.com" target="_blank">CSS-Tricks</a>.</p>
<div align="center"><a href="http://css-tricks.com" target="_blank" class="nostyle"><img src="http://static.jasongraphix.com/uploads/css-tricks.jpg" alt="CSS-Tricks" width="420" height="90" border="0" /></a></div>
<p>Chris is currently up to <a href="http://css-tricks.com/videos/" target="_blank">24 video screencasts</a> covering a wide range of basic-to-intermediate web design and development skills. I haven&#8217;t watched all of the videos yet, but from what I&#8217;ve seen, Chris has a knack for breaking down the tasks he&#8217;s explaining into easily digestible instructions.  I&#8217;ll definitely be adding <a href="http://css-tricks.com" target="_blank">CSS-Tricks.com</a> to my list of recommended resources.</p>
]]></content:encoded>
			<wfw:commentRss>http://jasongraphix.com/journal/photoshop-to-website/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
		<item>
		<title>CSS Blunders</title>
		<link>http://jasongraphix.com/journal/css-blunders/</link>
		<comments>http://jasongraphix.com/journal/css-blunders/#comments</comments>
		<pubDate>Tue, 20 May 2008 19:37:47 +0000</pubDate>
		<dc:creator>Jason Beaird</dc:creator>
				<category><![CDATA[CSS]]></category>
		<category><![CDATA[!important]]></category>
		<category><![CDATA[errors]]></category>
		<category><![CDATA[marging]]></category>
		<category><![CDATA[misspelling]]></category>
		<category><![CDATA[mistakes]]></category>
		<category><![CDATA[pebkac]]></category>
		<category><![CDATA[positon]]></category>

		<guid isPermaLink="false">http://beta.jasongraphix.com/journal/css-blunders/</guid>
		<description><![CDATA[
]]></description>
			<content:encoded><![CDATA[<p>I like to complain about browser inconsistency and rendering bugs as much as every other front-end developer, but it&#8217;s fairly common that the issues I&#8217;m experiencing are <a href="http://en.wikipedia.org/wiki/PEBKAC" title="Wikipedia:PEBKAC">PEBKAC</a> rather than IE induced. Now I know these won&#8217;t apply to most of you perfect coders out there, but I&#8217;m betting that at least a couple will ring true.</p>
<ol>
<li><strong>Typos</strong><br />
My most common blunder (by far) in writing CSS is misspelling selectors and<br />
properties.  I went on a rant about my tendency to spell position as<br />
<em><a href="http://www.jasongraphix.com/archive/2005/06/postion">positon</a></em> back in<br />
2005 and that one still gets me occasionally.  Most of the time<br />
<a href="http://en.wikipedia.org/wiki/Syntax_highlighting">syntax highlighting</a> saves the day,<br />
but there&#8217;s no help for misspelled selectors like <code>#haeder</code>, <code>.waring</code>, and <code>.altarnate</code>.
</li>
<li><strong>Missing Units</strong><br />
When using negative text-indent for text replacement, the set dimensions are the only<br />
thing holding open the block.  If you leave off a unit (<code>height:335;</code>) that<br />
block will completely disappear. As you might have guessed, this has <em>never</em> happened to me.
</li>
<li><strong>Z-idiot</strong><br />
Z-index is a practical and powerful tool when designing with CSS. The number one rule to remember when working<br />
with <code>z-index</code> is that the <code>position</code> property has to be set to<br />
<code>relative</code> (not realtive&#8230;), <code>fixed</code> or <code>absolute</code>. I&#8217;ve been known to arbitrarily insert <code>z-index</code><br />
all over my CSS&#8230;and then I realize the element I&#8217;m trying to stack doesn&#8217;t have a <code>position</code> declared.
</li>
<li><strong>Background Position</strong><br />
Is it <code>bottom 100px</code> or <code>100px bottom</code>? That question used to always trip me up. Then I&#8217;d get confused when it was broken in Firefox. The<br />
<a href="http://www.w3schools.com/css/pr_background-position.asp" title="">W3Schools&#8217; documentation of the <code>background-position</code> property</a> is<br />
fairly straightforward when it comes to similar units.  When using % or position values, you declare the horizontal (x) position and then the vertical (y).<br />
When you use keywords however, the examples suggest to declare the vertical keyword (top, center, bottom) first.  So, what if you want to mix keywords and values?<br />
In that case you follow the %/position convention and give the horizontal value first.  To answer my own question, it should always be <code>100px bottom</code>.<br />
For more info and examples, see my <a href="http://www.jasongraphix.com/archive/2007/08/background_posi">Background Position Compendium</a> post.
</li>
<li><strong>Bang Important</strong><br />
Cascading order and inheritance in CSS is a beautiful thing&#8230;until you start working on a large family of sites that inherits rules from<br />
multiple external stylesheets.  I personally see the <code>!important</code> rule (<code>.error {color:red !important;}</code>) as a hack and therefore try to avoid using it.  Occasionally though,<br />
it&#8217;s a handy tool and a necessary evil.  Just remember what properties of which elements you&#8217;ve set to important or you&#8217;re bound to<br />
pull your hair out later when you want to override them. If you need a quick refresher course, David Hellsing has a great article on <a href="http://monc.se/kitchen/38/cascading-order-and-inheritance-in-css" title="David's Kitchen: Cascading Order and Inheritance">Cascading Order and Inheritance</a>.</li>
</ol>
]]></content:encoded>
			<wfw:commentRss>http://jasongraphix.com/journal/css-blunders/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Unclickable Links in IE</title>
		<link>http://jasongraphix.com/journal/unclickable-links-in-ie/</link>
		<comments>http://jasongraphix.com/journal/unclickable-links-in-ie/#comments</comments>
		<pubDate>Tue, 15 Apr 2008 19:33:15 +0000</pubDate>
		<dc:creator>Jason Beaird</dc:creator>
				<category><![CDATA[CSS]]></category>
		<category><![CDATA[absolutely]]></category>
		<category><![CDATA[broken link]]></category>
		<category><![CDATA[bug]]></category>
		<category><![CDATA[error]]></category>
		<category><![CDATA[explorer]]></category>
		<category><![CDATA[Gif]]></category>
		<category><![CDATA[HTML]]></category>
		<category><![CDATA[ie]]></category>
		<category><![CDATA[links]]></category>
		<category><![CDATA[positioned]]></category>
		<category><![CDATA[spacer]]></category>
		<category><![CDATA[unclickable]]></category>
		<category><![CDATA[unhoverable]]></category>

		<guid isPermaLink="false">http://beta.jasongraphix.com/journal/unclickable-links-in-ie/</guid>
		<description><![CDATA[
]]></description>
			<content:encoded><![CDATA[<p>As with most trades, there are some tricks about web design that you only learn through experience.  Building complex layouts that avoid browser-specific hacks is certainly one of those tricks.  Yes, there are some hard and fast rules you can teach new designers &#8211; like how IE version 6 and below screw up the box model &#8211; but there are some pitfalls that will just drive you batty until you&#8217;ve expended countless, agonizing hours muttering under your breath as you write and re-write your CSS.</p>
<p>I&#8217;ve been there, done that, and built out enough standards-based designs to diagnose (and/or avoid) just about any rendering anomaly. As useful as that skill is though, I still occasionally find bugs that leave me completely bewildered.  Last week for instance, I had the same mind-melting problem pop up on two different sites.  While the individual cases were very different, the common denominator was that they were absolutely-positioned links that weren&#8217;t clickable or hoverable in any version of IE.  I didn&#8217;t write the code in question on either of these sites, but there was nothing <em>wrong</em> with it.  Here&#8217;s a quick example:</p>
<p class="noindent">
<strong>HTML</strong></p>
<pre>&lt;a class="clickme" href="#"&gt;Why can't you click me? :(&lt;/a&gt;</pre>
</p>
<p class="noindent">
<strong>CSS</strong></p>
<pre>
a.clickme {
display:block;
position:absolute;
top:5px;
left:5px;
height:150px;
width:200px;
font-size:1px;
text-indent:-9999px;
}
</pre>
<p>If I were doing something like the above example, I would typically put a background image in the link because, well, that&#8217;s what text-replacement is all about.  This particular link was placed over an image with a clickable area and therefore needed to be transparent.  No problem in Firefox, Safari, or Opera&#8230;but when I checked the site in IE, the link wasn&#8217;t working.</p>
<p>In troubleshooting the issue, I put a border around the link and there it was in the right position with the right dimensions. Next, I added a background to the hover state and attempted to hover the link area with the mouse. Nothing happened, so I added a background-color to the non-hover state and it worked fine. I took the background-color off and it was broken again.  Of course, the block needed to be transparent so at this point i was getting irritated. That&#8217;s when an idea came to me that I&#8217;m sure I&#8217;ll catch a lot of flack for: that&#8217;s right, I used a spacer gif.</p>
<p>I can think of several ways to avoid doing the link this way, but given the constraints of it having to be a transparent, absolutely positioned link, this seems like a good solution. <strong>Please check out <a href="http://www.jasongraphix.com/sandbox/absolutelinks/">the demo</a> in IE</strong> and let me know if I&#8217;m crazy (you probably already knew that) and what you might do differently.</p>
]]></content:encoded>
			<wfw:commentRss>http://jasongraphix.com/journal/unclickable-links-in-ie/feed/</wfw:commentRss>
		<slash:comments>8</slash:comments>
		</item>
		<item>
		<title>Active States on the Cheap</title>
		<link>http://jasongraphix.com/journal/active-states-on-the-cheap/</link>
		<comments>http://jasongraphix.com/journal/active-states-on-the-cheap/#comments</comments>
		<pubDate>Wed, 03 Oct 2007 03:12:08 +0000</pubDate>
		<dc:creator>Jason Beaird</dc:creator>
				<category><![CDATA[CSS]]></category>
		<category><![CDATA[active]]></category>
		<category><![CDATA[css active state]]></category>
		<category><![CDATA[easy peezy]]></category>
		<category><![CDATA[includes]]></category>
		<category><![CDATA[server-side]]></category>
		<category><![CDATA[subnav]]></category>

		<guid isPermaLink="false">http://beta.jasongraphix.com/journal/active-states-on-the-cheap/</guid>
		<description><![CDATA[
]]></description>
			<content:encoded><![CDATA[<p>Whenever I create a navigation block for a website, I make sure it falls within a universal include file. This ensures that if I need to add a page or change the site navigation in any way, I just need to edit one file. Whether I&#8217;m working on a PHP or .NET project, these includes get processed server-side, allowing me to add a bit of code to set active states on the nav items. On jasongraphix.com for instance, I&#8217;m parsing the <code>$_SERVER['REQUEST_URI'];</code> and using the first &#8220;folder&#8221; to determine which list item to add an active id to.  On .NET projects, I&#8217;ll usually pass a sectionname and pagename variable along with the include request and use that to choose the active section/page.  Unless you&#8217;re running a completely database driven site, this is standard industry practice.  Occasionally though, I have to add subnavigation to pages on older websites where site-wide include files do not exist, or where server-side coding isn&#8217;t an option.  In these situations, I still want to get the navigation I&#8217;m working on into an include as it doesn&#8217;t take that much longer and will save me future work if the client decides to rearrange/rename any of the new pages.</p>
<p>Even on static html sites, you can usually use the good ole&rsquo; server-side include syntax to add a repeated block of code to multiple pages:</p>
<pre>&lt;!--#include FILE="subnav-section.inc" --&gt;</pre>
<p>Now let&#8217;s say you have a nav list in there like this:</p>
<pre>
&lt;ul class="subnav"&gt;
&lt;li&gt;&lt;a href="1.html">Chocolate&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="2.html">Hazelnut&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="3.html">Coffee&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="4.html">Cake&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;
</pre>
<p>Hopefully, you don&#8217;t give your pages vague names like <code>1.html</code>, I&#8217;m just tossing those in there for brevity. Anyway, let&#8217;s say you want to change the background and text color to indicate which page you&#8217;re on &#8211; yea, I know&#8230;an active state, I was just explaining for those who might not know.</p>
<p>One cheap and dirty way I&#8217;ve found to do this is to add a wrapper div or even the <code>&lt;ul&gt;</code> itself around the include call with an added class that is specific to the page you&#8217;re on.  Then, you can add the same class to the link and use the combination to set the active state.</p>
<p>To demonstrate, if you&#8217;re on the Coffee page (and who isn&#8217;t), your include call might look like:</p>
<pre>
&lt;ul class="subnav coffee"&gt;
&lt;!--#include FILE="subnav-tasty.inc" --&gt;
&lt;/ul&gt;
</pre>
<p>Inside that include, you&#8217;d have:</p>
<pre>
&lt;li&gt;&lt;a href="1.html" class="chocolate">Chocolate&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="2.html" class="hazelnut">Hazelnut&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="3.html" class="coffee">Coffee&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="4.html" class="cake">Cake&lt;/a&gt;&lt;/li&gt;
</pre>
<p>Then, within your css, you would add something like this:</p>
<pre>
.chocolate li a.chocolate,
.hazelnut li a.hazelnut,
.coffee li a.coffee,
.cake li a.cake{
background:#000;
color:#fff;
}
</pre>
<p>And viola, if you&#8217;re on the coffee page, the coffee nav item now has white text on a black background.  Easy peasy.</p>
]]></content:encoded>
			<wfw:commentRss>http://jasongraphix.com/journal/active-states-on-the-cheap/feed/</wfw:commentRss>
		<slash:comments>6</slash:comments>
		</item>
		<item>
		<title>Background Position Compendium</title>
		<link>http://jasongraphix.com/journal/background-position-compendium/</link>
		<comments>http://jasongraphix.com/journal/background-position-compendium/#comments</comments>
		<pubDate>Tue, 14 Aug 2007 18:03:36 +0000</pubDate>
		<dc:creator>Jason Beaird</dc:creator>
				<category><![CDATA[CSS]]></category>
		<category><![CDATA[background-position]]></category>
		<category><![CDATA[bottom]]></category>
		<category><![CDATA[center]]></category>
		<category><![CDATA[css background position]]></category>
		<category><![CDATA[horizontal]]></category>
		<category><![CDATA[left]]></category>
		<category><![CDATA[mixing background position value]]></category>
		<category><![CDATA[percent]]></category>
		<category><![CDATA[pixels]]></category>
		<category><![CDATA[right]]></category>
		<category><![CDATA[top]]></category>
		<category><![CDATA[values]]></category>
		<category><![CDATA[vertical]]></category>

		<guid isPermaLink="false">http://beta.jasongraphix.com/journal/background-position-compendium/</guid>
		<description><![CDATA[
]]></description>
			<content:encoded><![CDATA[<p>When I was writing <a href="http://www.sitepoint.com/launch/8e91955/3/83">The Principles of Beautiful Web Design</a>, I had no idea that the section with the most overlooked <a href="http://www.sitepoint.com/books/design1/errata.php">typos and errors</a> would be the segment on background positioning. Backgrounds   are such an integral part of what I do that I neglected to test what I was writing. However, I knew all along that there <em>is</em> some trickiness to the <a href="http://www.w3schools.com/css/pr_background-position.asp">CSS background-position</a> description, specifically when you start mixing keyword values (<code>top, bottom, left, right,</code> and <code>center</code>) with numeric or percentage values.</p>
<p>The main problem is that the keyword values are to be declared with the vertical value first and then the horizontal (ie, <code>bottom right</code>). With numeric and percentage positioning, you declare them the opposite; horizontal value first and then the vertical.  This creates some confusion when you want to do something funky like specify a pixel value for the horizontal position of a bottom aligned background. Do you say <code>bottom 100px</code> or <code>100px bottom</code>?  It would be nice if the browser made the assumption that if you declare an explicitly vertical keyword like <code>bottom</code>, then the other value is horizontal.  Safari and IE make this assumption, but <strong>Firefox and Opera will only accept one order</strong>.  If you get the order wrong, the browser will give up on positioning the background altogether and place your background in the default <code>top left</code> corner.</p>
<div align="center"><img src="http://static.jasongraphix.com/uploads/background-position-firefox.gif" width="372" height="222" alt="Firefox giving up on positioning a background specified as bottom 100px" /></div>
<p><em>How nice.</em> To avoid this problem, and for the sake of consistency (and sanity) you should <strong>always declare the horizontal value first and then the vertical</strong>.  Even if you are using only keywords, <code>bottom center</code> and <code>center bottom</code> both render the same way, and even though the <a href="http://www.w3schools.com/css/pr_background-position.asp">W3Schools says</a> the former is correct, they <a href="http://jigsaw.w3.org/css-validator/validator?text=.bottomcenter+%7Bbackground-position%3Abottom+center%3B%7D%0D%0A.centerbottom+%7Bbackground-position%3Acenter+bottom%3B%7D&amp;usermedium=all&&amp;warning=1&&amp;profile=css21&&amp;usermedium=all">both validate</a>.</p>
<p>To figure all this out, I set up a page with 24 different combinations of background-position values containing <code>bottom, right, center, 100px,</code> and <code>80%</code>.  I left out <code>top</code> and <code>left</code> because either of these could be specified simply as <code>0</code> which would eliminate the need to mix keywords with numeric values alltogether.</p>
<p>Enjoy: <strong><a href="http://jasongraphix.com/sandbox/background-position/" title="For your background-position testing pleasure...">The Background Position Compendium</a></strong></p>
]]></content:encoded>
			<wfw:commentRss>http://jasongraphix.com/journal/background-position-compendium/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
		<item>
		<title>CSS CacheBuster</title>
		<link>http://jasongraphix.com/journal/css-cachebuster/</link>
		<comments>http://jasongraphix.com/journal/css-cachebuster/#comments</comments>
		<pubDate>Thu, 02 Aug 2007 17:42:16 +0000</pubDate>
		<dc:creator>Jason Beaird</dc:creator>
				<category><![CDATA[CSS]]></category>
		<category><![CDATA[bookmarklet]]></category>
		<category><![CDATA[cachebuster]]></category>
		<category><![CDATA[css cachebuster]]></category>
		<category><![CDATA[css caching]]></category>
		<category><![CDATA[favelet]]></category>
		<category><![CDATA[query string]]></category>
		<category><![CDATA[server-side caching]]></category>

		<guid isPermaLink="false">http://beta.jasongraphix.com/journal/css-cachebuster/</guid>
		<description><![CDATA[
]]></description>
			<content:encoded><![CDATA[<p>I&rsquo;m sure just about every web developer is familiar with client-side stylesheet caching. You know how it goes, you&rsquo;re making changes to a stylesheet and checking them in your browser and then, all of a sudden, the updates you made don&rsquo;t show up.  When this happens, you either click refresh like a spastic monkey or clear your browser cache and the world returns to normal.</p>
<p>Much more frustrating than that experience is server-side stylesheet caching.  Although I&rsquo;ve seen this happen periodically on Linux servers as well, our Windows testing server here in the office is a cache maniac.  If you refresh a page on the server a few times, the machine will start serving a cached version of the stylesheet&#8230;and continue doing so for several minutes.  You can clear your browser cache and refresh a zillion times, but you&rsquo;ll still get the cached version.  When you point your browser directly to the CSS file, it will actually show the latest version, but when you go back to the page you were trying to refresh, or any page that links to that stylesheet, you&rsquo;ll still get the cached version. It&rsquo;s enough to drive me mad, especially when I&rsquo;m already working on fixing quirky IE issues.</p>
<p>While the server caching settings really should be reconfigured, the accepted local method of dealing with this annoyance is to add a query string to the stylesheet url like so:</p>
<pre>&lt;link rel="stylesheet" type="text/css" media="screen" href="css/screen.css?foo"/&gt;</pre>
<p>This essentially fools the server into thinking the file must have server-side code, hence forcing it to re-load the stylesheet.</p>
<p>While this parlor trick stops the server-side caching, we often work on sites that do not have the stylesheet seperated into an include, so you can add the <code>?foo</code> to the stylesheet href value on one page, and as soon as you jump to another page, you get the old stylesheet again.  Additionally, we often forget in our final cleanup to remove the query strings when we&rsquo;re done working on a site, leaving behind our query-stringed stylesheet links for the world to see.  Bah!</p>
<p><strong>What&rsquo;s the solution?</strong> Ideally, adjusting the server&rsquo;s cache settings.  As a stopgap though, or for situations where I don&rsquo;t have control over the server&rsquo;s cache settings, I wrote a bookmarklet that reloads all the linked stylesheets with a query string of the current timestamp attached.  I used a timestamp rather than the usual <code>?foo</code> because sometimes it seems like the server caches the <code>?foo</code> query string and we end up using <code>?foo1, ?foo2, ?foo3</code>&#8230; This way, the query string is guaranteed to stay unique.</p>
<p class="noindent"><strong><a href="javascript:(function(){var s,i,x;x=document.getElementsByTagName('link');for(i=0;i<x.length;i++){x[i].href=x[i].href+'?'+new Date().getTime();}})();">CSS Cachebuster</a></strong><br /><em>As usual with bookmarklets, just right click on the link and &#8220;save link as&#8221; or drag it into your bookmarks toolbar.</em></p>
<p>I know, I know, it&rsquo;s not all that impressive, but I&rsquo;m proud of my little bookmarklet.  As I keep telling <a href="http://www.dustindiaz.com/">Dustin</a> and my other <code>133t Hax0r</code> friends, I&rsquo;m a designer, not a coder.  Now feel free to pick it apart and tell me what you would have done differently and I&rsquo;ll update the link above accordingly.</p>
<p>&nbsp;</p>
]]></content:encoded>
			<wfw:commentRss>http://jasongraphix.com/journal/css-cachebuster/feed/</wfw:commentRss>
		<slash:comments>12</slash:comments>
		</item>
		<item>
		<title>Times Naked Roman</title>
		<link>http://jasongraphix.com/journal/times-naked-roman/</link>
		<comments>http://jasongraphix.com/journal/times-naked-roman/#comments</comments>
		<pubDate>Mon, 02 Apr 2007 16:45:26 +0000</pubDate>
		<dc:creator>Jason Beaird</dc:creator>
				<category><![CDATA[CSS]]></category>
		<category><![CDATA[css naked day]]></category>
		<category><![CDATA[naked]]></category>
		<category><![CDATA[stylesheets]]></category>
		<category><![CDATA[times new roman]]></category>
		<category><![CDATA[unstyled]]></category>

		<guid isPermaLink="false">http://beta.jasongraphix.com/journal/times-naked-roman/</guid>
		<description><![CDATA[
]]></description>
			<content:encoded><![CDATA[<p>As the days grow longer and flowers begin to burst forth from the tawny winter landscape, I am reminded of one thing &mdash; it&rsquo;s time to <strong>GET NAKED</strong>! As nonbelligerent as I am about validation and semantic markup, it makes me grin with mischievously nerdy glee when I think about <a href="http://naked.dustindiaz.com">CSS Naked Day</a>. Dustin&rsquo;s idea is genius, really.  In case you have no idea what&rsquo;s going on there, CSS Naked Day is basically a chance to show the world the power of stylesheets by simply removing them from our websites.  To the general public, a good website design is nothing more than a cosmetic attribute.  Appearances though, can be deceiving.  Beneath the pretty layouts, colors, and type some websites are hacked together with their structure (HTML) hideously intertwined with presentation (CSS).  By keeping these elements seperated, the web become much more printable, readable, flexible and ultimately more beautiful.  It&rsquo;s easy to tell if a website properly separates these two elements by simply turning off the presentation layer or CSS.</p>
<p>On April 5th, 2007 hundreds of websites will &ldquo;go naked&rdquo; by turning off their stylesheets, showing the world their pale-white, Times New Roman scribbled &lt;body&gt;s.  I&rsquo;ll be stripping down this website, as well as the website for <a href="http://www.principlesofbeautifulwebdesign.com/">my book</a>, and <a href="http://www.amesnjas.com/">amesnjas.com</a> as well. Oh the humanity!</p>
]]></content:encoded>
			<wfw:commentRss>http://jasongraphix.com/journal/times-naked-roman/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
		<item>
		<title>hCard Mapping</title>
		<link>http://jasongraphix.com/journal/hcard-mapping/</link>
		<comments>http://jasongraphix.com/journal/hcard-mapping/#comments</comments>
		<pubDate>Mon, 22 Jan 2007 16:01:39 +0000</pubDate>
		<dc:creator>Jason Beaird</dc:creator>
				<category><![CDATA[CSS]]></category>
		<category><![CDATA[hCard]]></category>
		<category><![CDATA[hCard locations]]></category>
		<category><![CDATA[hCard Mapping]]></category>
		<category><![CDATA[jQuery]]></category>
		<category><![CDATA[mapping microformats]]></category>
		<category><![CDATA[microformats]]></category>
		<category><![CDATA[positioning]]></category>
		<category><![CDATA[vCard]]></category>

		<guid isPermaLink="false">http://beta.jasongraphix.com/journal/hcard-mapping/</guid>
		<description><![CDATA[
]]></description>
			<content:encoded><![CDATA[<p>When I first heard about <a href="http://microformats.org/about/" title="Microformats:About">Microformats</a>, I was a little confused about all the excitement.  I may be a technically minded person (sometimes) but the idea of making information more machine readable didn&#8217;t make me bounce around with glee.  Nevertheless, I felt obligated to do my part in advancing the evolution of the internet and started looking into the documentation.  Despite all of the technical minutiae that exists in <a href="http://microformats.org/wiki/" title="Microformats:Wiki">the wiki</a>, Microformats are very easy to understand and implement. In most cases this simply involves wrapping certain types of data with <code>&lt;div&gt;</code>s or <code>&lt;span&gt;</code>s and tagging them with a predefined class name. By wrapping and tagging these pieces and sets of information, they can then be extracted and utilized by other programs, apps, and scripts. Obviously, there&#8217;s a lot more to it than this, but that&#8217;s the gist of it.</p>
<p>What does this look like for you as a constructor of websites? Well, let&#8217;s use the ubiquitous <a href="http://microformats.org/wiki/hcard" title="hCard: Microformats Wiki">hCard</a> as an example.  According to the wiki:</p>
<blockquote><div>hCard is a simple, open, distributed format for representing people, companies, organizations, and places&#8230;</div>
</blockquote>
<p>So, any time you want to display contact information on a website for any of the types of entities listed above, you would use the hCard format. To make it uber-simple, the Microformats authors have even set up an <a href="http://microformats.org/code/hcard/creator" title="Creator-o-hCards">hCard Creator</a>.  In the form, you can enter as little or as much information as you&#8217;d like, and it will spit out the appropriately formed hCard code:</p>
<pre>
&lt;div class="vcard"&gt;
&lt;a class="url fn n" href="http://www.jasongraphix.com/"&gt;
&lt;span class="given-name"&gt;Jason&lt;/span&gt;
&lt;span class="additional-name"&gt;Edmond&lt;/span&gt;
&lt;span class="family-name"&gt;Beaird&lt;/span&gt;
&lt;/a&gt;
&lt;div class="adr"&gt;
&lt;span class="locality"&gt;Columbia&lt;/span&gt;,
&lt;span class="region"&gt;SC&lt;/span&gt;
&lt;span class="country-name"&gt;USA&lt;/span&gt;
&lt;/div&gt;
&lt;div class="tel"&gt;123-456-7890&lt;/div&gt;
&lt;/div&gt;
</pre>
<p>Viola! A nice little bundle of information stored in appropriately tagged <code>&lt;div&gt;</code>s and <code>&lt;span&gt;</code>s. But whatever should I do with it? That&#8217;s what I was asking myself last week when I created a set of hCards for the regional offices of a corporate client.  With a little CSS lovin&#8217; and a couple simple jQuery functions, I created a page that highlighted each office&#8217;s contact information and map location when you hovered over either the map location or the hCard details.  Confused?  Well, I&#8217;ve adapted the main concept into a similar example.  Instead of regional headquarters, I&#8217;ve used the locations of a few people who&#8217;s blog I read.  Instead of map dots, I&#8217;ve used each website&#8217;s favicon.  Clicking on either the favicon or the hCard will take you to that person&#8217;s site.  Feel free to download and use this example however you see fit. Enjoy!</p>
<p><strong>hCard Mapping: <a href="http://www.jasongraphix.com/sandbox/hcard/">Example</a> &#8211; <a href="http://www.jasongraphix.com/sandbox/hcard/hcard-map.zip">Download</a> (24 KB)</strong></p>
]]></content:encoded>
			<wfw:commentRss>http://jasongraphix.com/journal/hcard-mapping/feed/</wfw:commentRss>
		<slash:comments>5</slash:comments>
		</item>
	</channel>
</rss>

