<?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>CSSKarma &#187; CSS</title>
	<atom:link href="http://www.csskarma.com/blog/tag/css/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.csskarma.com/blog</link>
	<description>display your &#60;style&#62;</description>
	<lastBuildDate>Sun, 11 Jul 2010 04:57:06 +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>Books that made me a better designer</title>
		<link>http://www.csskarma.com/blog/books/</link>
		<comments>http://www.csskarma.com/blog/books/#comments</comments>
		<pubDate>Fri, 07 May 2010 17:46:26 +0000</pubDate>
		<dc:creator>Tim</dc:creator>
				<category><![CDATA[Web Design]]></category>
		<category><![CDATA[ajax]]></category>
		<category><![CDATA[books]]></category>
		<category><![CDATA[CSS]]></category>
		<category><![CDATA[learning]]></category>
		<category><![CDATA[mobile]]></category>
		<category><![CDATA[sketching]]></category>
		<category><![CDATA[ui]]></category>

		<guid isPermaLink="false">http://www.csskarma.com/blog/?p=819</guid>
		<description><![CDATA[This is a list of books that have had a big impact on the way I design &#38; developer Web sites. A lot of the content in books now-a-days can be found on various blogs, but the books below all have something in them that I really haven&#8217;t been able to find anywhere else. Transcending [...]]]></description>
			<content:encoded><![CDATA[<p>This is a list of books that have had a big impact on the way I design &amp; developer Web sites. A lot of the content in books now-a-days can be found on various blogs, but the books below all have something in them that I really haven&#8217;t been able to find anywhere else.</p>
<div class="book">
	<a href="http://www.transcendingcss.com/"></p>
<h3>Transcending CSS</h3>
<p>        <img src="http://www.csskarma.com/images/posts/transcendingcss.jpg" alt="Transcending CSS book cover"><br />
        </a></p>
<p class="author"><a href="http://www.stuffandnonsense.co.uk/">Andy Clarke</a></p>
<p class="desc">Andy&#8217;s book is obviously very technically good and well written. I certainly got a lot of information like that out of it, but at this point you can find most of it on various blogs. My biggest take away was how Andy spoke about semantics. Specifically using IDs like &#8220;branding&#8221; and &#8220;site-info&#8221; rather than &#8220;header&#8221; and &#8220;footer&#8221;. Up to that point I had just been using &#8220;header&#8221; and &#8220;footer&#8221; because it was how it was done at the time. Andy got me thinking heavily about semantics and naming schema and also opened up a lot of doors for me to really examine how I put together a site instead of blindly do it because it&#8217;s what I&#8217;ve heard is the best.</p>
</div>
<p><!--/.book--></p>
<div class="book">
	<a href="http://bulletproofajax.com/"></p>
<h3>Bulletproof Ajax</h3>
<p>        <img src="http://www.csskarma.com/images/posts/bulletproofajax.jpg" alt="Bulletproof Ajax book cover"><br />
        </a></p>
<p class="author"><a href="http://adactio.com/">Jeremy Keith</a></p>
<p class="desc">I read this book right around the time I began playing with <a href="http://jquery.com">jQuery</a> and it made me realize that, however great a library like jQuery may be, it won&#8217;t be around forever and if I don&#8217;t learn how it really works, I&#8217;ll be screwed when it finally disappears like so many other Web technologies. In <i>Bulletproof Ajax</i> I learned how exactly the XMLHTTPRequest worked, what jQuery was doing, and how it made it so easy to work with, all while keeping Web standards in sight and never putting something together that couldn&#8217;t function without JavaScript.</p>
</div>
<p><!--/.book--></p>
<div class="book">
	<a href="http://www.amazon.com/101-Things-Learned-Architecture-School/dp/0262062666"></p>
<h3>101 Things I Learned in Architecture School</h3>
<p>        <img src="http://www.csskarma.com/images/posts/101things.jpg" alt="101 Things I Learned in Architecture School book cover"><br />
        </a></p>
<p class="author"><a href="http://www.frederickdesignstudio.com/">Matthew Frederick</a></p>
<p class="desc">Drawing lines seems like a stupid thing to want to learn, but that&#8217;s what this book effectively taught me. I learned the importance of some very basic design principles and how to effectively communicate those ideas to others through certain shapes and sketching techniques. <strong>This is a great book</strong>. I really got into it after a talk by <a href="http://www.lukew.com/">Luke Wroblewski</a> at the Web App Summit in Newport Beach.</p>
</div>
<p><!--/.book--></p>
<div class="book">
	<a href="http://mobilewebbook.com/"></p>
<h3>Mobile Web Design</h3>
<p>        <img src="http://www.csskarma.com/images/posts/mobilewebdesign.jpg" alt="Mobile Web Design book cover"><br />
        </a></p>
<p class="author"><a href="http://cameronmoll.tumblr.com/">Cameron Moll</a></p>
<p class="desc">The first book to really spark my interest in the Mobile Web. Ever since reading it I&#8217;ve felt like I have a slight edge whenever beginning a project with mobile requirements. Most mobile books now focus on intense graphics and acceleration of devices like the iPhone. In <i>Mobile Web Design</i>, Cameron talks about a plethora of devices and focuses on Web standards rather than cool things you can do.</p>
</div>
<p><!--/.book--></p>
<p>Obviously, I highly recommend all those these books, as they&#8217;ve had a pretty large impact on me as a designer &amp; a developer. The best part about them is that they&#8217;re all pretty easy reads, they&#8217;re not the kind of books you have to spend a week or 2 reading.</p>
<p>Does anyone else have books like this? Or do we all just read blogs now?</p>
]]></content:encoded>
			<wfw:commentRss>http://www.csskarma.com/blog/books/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>What You Need to Know About Behavioral CSS</title>
		<link>http://www.csskarma.com/blog/behavioral-css/</link>
		<comments>http://www.csskarma.com/blog/behavioral-css/#comments</comments>
		<pubDate>Mon, 21 Dec 2009 16:46:32 +0000</pubDate>
		<dc:creator>Tim</dc:creator>
				<category><![CDATA[Web Design]]></category>
		<category><![CDATA[Web Development]]></category>
		<category><![CDATA[article]]></category>
		<category><![CDATA[CSS]]></category>
		<category><![CDATA[smashing magazine]]></category>

		<guid isPermaLink="false">http://www.csskarma.com/blog/?p=681</guid>
		<description><![CDATA[Hi all, I had a new article published over the weekend at Smashing Magazine. Check it out and let me know what you think! Behavioral CSS I wrote it quite a while ago and it seems to be showing a bit in the comments, but overall, I&#8217;m pretty happy with the way it came out [...]]]></description>
			<content:encoded><![CDATA[<p><img src="http://www.csskarma.com/blog/wp-content/uploads/smashing-banner1.png" alt="" title="smashing-banner" class="article-banner"/></p>
<p>Hi all,<br />
I had a new article published over the weekend at Smashing Magazine. Check it out and let me know what you think!</p>
<p><a href="http://www.smashingmagazine.com/2009/12/19/what-you-need-to-know-about-behavioral-css/">Behavioral CSS</a></p>
<p>I wrote it quite a while ago and it seems to be showing a bit in the comments, but overall, I&#8217;m pretty happy with the way it came out and the reader responses it&#8217;s getting. Hope you enjoy <a href="http://www.smashingmagazine.com/2009/12/19/what-you-need-to-know-about-behavioral-css/">Behavioral CSS</a></p>
]]></content:encoded>
			<wfw:commentRss>http://www.csskarma.com/blog/behavioral-css/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Quick Tip #1 &#8211; Image Replacement</title>
		<link>http://www.csskarma.com/blog/qt1-image-replacement/</link>
		<comments>http://www.csskarma.com/blog/qt1-image-replacement/#comments</comments>
		<pubDate>Thu, 28 May 2009 14:19:57 +0000</pubDate>
		<dc:creator>Tim</dc:creator>
				<category><![CDATA[Web Development]]></category>
		<category><![CDATA[CSS]]></category>

		<guid isPermaLink="false">http://www.csskarma.com/blog/?p=535</guid>
		<description><![CDATA[Problem Image replacement can be easily abused; but when used properly (like replacing logo text) it&#8217;s a great resource. Image replacement without extra markup usually means setting text-indent:-9999px on your link. And this works great great. But in a lot of browsers it leaves a focus outline that runs way off the page to the [...]]]></description>
			<content:encoded><![CDATA[<p><img src="http://www.csskarma.com/images/articles/image-replacement.jpg" alt="article banner"/></p>
<h4>Problem</h4>
<p>Image replacement can be easily <a href="http://www.csszengarden.com" rel="external">abused</a>; but when used properly (like replacing logo text) it&#8217;s a great resource.</p>
<p>Image replacement without extra markup usually means setting <code>text-indent:-9999px</code> on your link. And this works great great. But in a lot of browsers it leaves a focus outline that runs way off the page to the left on click.</p>
<p><img src="http://www.csskarma.com/images/articles/logo_beans_error.jpg" alt="welovebeans.com logo with a :focus outline the runs off the page" /></p>
<p>We need to keep the outline there for accessibility reasons, so most developers just leave it alone. But there&#8217;s a way to make, both, designers and accessibility gurus happy.</p>
<p class="viewdemo"><a href="http://www.csskarma.com/articles/examples/image-replacement/">view demo</a></p>
<h5>Problem CSS</h5>
<pre><code>
#branding h1 a{
display:block;
height:70px;
width:289px;
background:url(../images/logo.png) no-repeat 0 0;
<strong>text-indent:-9999px;</strong>
}</code></pre>
<h4>Goal</h4>
<p><img src="http://www.csskarma.com/images/articles/logo_beans_clean.jpg" alt="welovebeans.com logo with proper :focus outline" /></p>
<h4>Solution</h4>
<p>By adding <code>overflow:hidden</code> to the link we can cut off the extended :focus outline.</p>
<h5>Solution CSS</h5>
<pre><code>
#branding h1 a{
display:block;
height:70px;
width:289px;
background:url(../images/logo.png) no-repeat 0 0;
<strong>text-indent:-9999px;
overflow:hidden;</strong>
}</code></pre>
<p class="viewdemo"><a href="http://www.csskarma.com/articles/examples/image-replacement/">view demo</a></p>
]]></content:encoded>
			<wfw:commentRss>http://www.csskarma.com/blog/qt1-image-replacement/feed/</wfw:commentRss>
		<slash:comments>6</slash:comments>
		</item>
		<item>
		<title>SXSW Notes pt. 3 &#8211; CSS3</title>
		<link>http://www.csskarma.com/blog/sxsw-notes-pt3/</link>
		<comments>http://www.csskarma.com/blog/sxsw-notes-pt3/#comments</comments>
		<pubDate>Fri, 20 Mar 2009 14:50:02 +0000</pubDate>
		<dc:creator>Tim</dc:creator>
				<category><![CDATA[Browsers]]></category>
		<category><![CDATA[Life]]></category>
		<category><![CDATA[CSS]]></category>
		<category><![CDATA[sxsw]]></category>

		<guid isPermaLink="false">http://www.csskarma.com/blog/?p=409</guid>
		<description><![CDATA[This panel had representitives from each vendor (not apple) and they each took turns showcasing the upcoming CSS3 support in their browser. MOZ nth-child selector color module [opacity, rbga] border-image border-radius box-shadow * word-wrap:break-word * font-adjust @font-face @media queries ( @media(width:22em){blah} -moz-transform: skewX(20deg); -webkit-transform: skewX(20deg); Future from MOZ width calculations new layout systems for user [...]]]></description>
			<content:encoded><![CDATA[<p><img src="http://www.csskarma.com/images/articles/sxsw.jpg" alt="article banner"/></p>
<p>This panel had representitives from each vendor (not apple) and they each took turns showcasing the upcoming CSS3 support in their browser.</p>
<h4>MOZ</h4>
<ul>
<li>nth-child selector</li>
<li>color module [opacity, rbga]</li>
<li>border-image</li>
<li>border-radius</li>
<li>box-shadow</li>
<li>* word-wrap:break-word</li>
<li>* font-adjust</li>
<li>@font-face</li>
<li>@media queries ( @media(width:22em){blah}</li>
<li>-moz-transform: skewX(20deg);</li>
<li>-webkit-transform: skewX(20deg);</li>
</ul>
<h5>Future from MOZ</h5>
<ul>
<li>width calculations</li>
<li>new layout systems for user interface</li>
</ul>
<h4>Microsoft &#8211; IE and CSS</h4>
<ul>
<li>implementing 2.1</li>
<li>1st complete implementation on 2.1</li>
</ul>
<h5>In IE8</h5>
<ul>
<li>no new CSS3 properties</li>
</ul>
<h5>Future of CSS in IE</h5>
<ul>
<li>opacity</li>
<li>backgrounds</li>
<li>web fonts</li>
<li>media queries</li>
<li>mutil-column</li>
</ul>
<h4>Opera</h4>
<ul>
<li>text-shadow (css2)</li>
<li>webfonts (css2)</li>
</ul>
<h5>CSS3</h5>
<ul>
<li>backgrounds and borders</li>
<li>border-radius: 150px / 50px;</li>
<li>box-shadows, blur, inset</li>
<li>border-image</li>
<li>a box css3 style</li>
<li>css transitions (animations)</li>
</ul>
]]></content:encoded>
			<wfw:commentRss>http://www.csskarma.com/blog/sxsw-notes-pt3/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
		<item>
		<title>This Week in Links 2/18</title>
		<link>http://www.csskarma.com/blog/this-week-in-links-13/</link>
		<comments>http://www.csskarma.com/blog/this-week-in-links-13/#comments</comments>
		<pubDate>Wed, 18 Feb 2009 19:30:20 +0000</pubDate>
		<dc:creator>Tim</dc:creator>
				<category><![CDATA[News]]></category>
		<category><![CDATA[Web Development]]></category>
		<category><![CDATA[CSS]]></category>
		<category><![CDATA[flickr]]></category>
		<category><![CDATA[json]]></category>
		<category><![CDATA[navigation]]></category>
		<category><![CDATA[public speaking]]></category>

		<guid isPermaLink="false">http://www.csskarma.com/blog/?p=354</guid>
		<description><![CDATA[Surfin&#8217; Safari: CSS Animation Personally, I think animation should be left to JavaScript, but this is actually pretty neat, you have to download the open source version of WebKit to see it, but it&#8217;s definitely worth a look into the future of CSS. Get Your Flickr ID I&#8217;m currently building a refreshed version of cssKarma.com [...]]]></description>
			<content:encoded><![CDATA[<p><img src="http://www.csskarma.com/images/articles/this-week-in-links.jpg" alt="article banner"/></p>
<h5><a href="http://webkit.org/blog/324/css-animation-2/" rel="external">Surfin&#8217; Safari: CSS Animation</a></h5>
<p>Personally, I think animation should be left to JavaScript, but this is actually pretty neat, you have to download the <a href="http://webkit.org/" rel="external">open source version of WebKit</a> to see it, but it&#8217;s definitely worth a look into the future of CSS.</p>
<h5><a href="http://idgettr.com/" rel="external">Get Your Flickr ID</a></h5>
<p>I&#8217;m currently building a refreshed version of cssKarma.com and I want to display my Flickr photos on the site, but I couldn&#8217;t find my damn ID to grab the JSON feed. This is a neat little app that can quickly get your Flickr ID.</p>
<h5><a href="http://cameronmoll.com/archives/2009/02/20_tips_better_conference_speaking/index.html" rel="external">20 Tips for better Conference Speaking</a></h5>
<p>Cameron Moll lists out 20 great points on how to grab your audience while speaking. Since I know I have this problem from time to time, I thought this was an excellent read and very share&ndash;worthy.</p>
<h5><a href="http://aviary.com/home" rel="external">Aviary</a></h5>
<p>Aviary is like an online version of PhotoShop. But that&#8217;s not why they&#8217;re on this list, I think I&#8217;ve actually posted this link before; but now they have a real slick new navigation menu that I LOVE. Check this out, it&#8217;s very interesting.</p>
<p><strong>Something else to read over: <a href="http://xrds-simple.net/" rel="external">XRDS</a></strong></p>
]]></content:encoded>
			<wfw:commentRss>http://www.csskarma.com/blog/this-week-in-links-13/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>Framing an Image</title>
		<link>http://www.csskarma.com/blog/framing-an-image/</link>
		<comments>http://www.csskarma.com/blog/framing-an-image/#comments</comments>
		<pubDate>Mon, 09 Feb 2009 05:59:09 +0000</pubDate>
		<dc:creator>Tim</dc:creator>
				<category><![CDATA[Web Development]]></category>
		<category><![CDATA[CSS]]></category>

		<guid isPermaLink="false">http://www.csskarma.com/blog/?p=324</guid>
		<description><![CDATA[I&#8217;m not sure exactly how well known it is, but you can put a background image on any HTML element&#8230; even an image. I don&#8217;t think I&#8217;ve ever seen it done on a live site before, but it can be very useful for creating an image template for repeated use; without having to do a [...]]]></description>
			<content:encoded><![CDATA[<p><img src="http://www.csskarma.com/images/articles/framing-an-image.jpg" alt="article banner"/></p>
<p>I&#8217;m not sure exactly how well known it is, but you can put a background image on any HTML element&#8230; even an image. I don&#8217;t think I&#8217;ve ever seen it done on a live site before, but it can be very useful for creating an image template for repeated use; without having to do a ton of photo editing. Like in a portfolio or image gallery.</p>
<p>The goal of this post is to show how you can display a decorative frame around an image with minimal markup (just your img element, and maybe a class).</p>
<p class="viewdemo"><a href="http://www.csskarma.com/articles/examples/background-image/">View Demo</a></p>
<p>The first thing I like to do when doing any serious CSS for an image is set the <code>display</code> to <code>block</code>. This allows us to do a little more with it since inline elements do have some limitations on them. So let&#8217;s do that:</p>
<h5>CSS</h5>
<pre><code>img{
display:block;
}</code></pre>
<p>Next, we set our background image to the <code>img</code>. I chose a polaroid</p>
<h5>CSS</h5>
<pre><code>img{
display:block;
background:url(polaroid.png);
}</code></pre>
<p>Then set our padding accordingly so the background image shows through, I also floated it left, for some reason.</p>
<h5>CSS</h5>
<pre><code>img{
display:block;
background:url(polaroid.png);
padding:19px 25px 80px 17px;
float:left;
}</code></pre>
<p>And there you have it, a quick and easy way to add some *pop* to images on your site.</p>
<p><img src="http://www.csskarma.com/images/articles/dog_polaroid.jpg" alt="show padding"/></p>
<p class="viewdemo"><a href="http://www.csskarma.com/articles/examples/background-image/">View Demo</a></p>
]]></content:encoded>
			<wfw:commentRss>http://www.csskarma.com/blog/framing-an-image/feed/</wfw:commentRss>
		<slash:comments>10</slash:comments>
		</item>
		<item>
		<title>Centering an Image</title>
		<link>http://www.csskarma.com/blog/centering-an-image/</link>
		<comments>http://www.csskarma.com/blog/centering-an-image/#comments</comments>
		<pubDate>Tue, 06 Jan 2009 15:41:56 +0000</pubDate>
		<dc:creator>Tim</dc:creator>
				<category><![CDATA[Web Development]]></category>
		<category><![CDATA[Web Standards]]></category>
		<category><![CDATA[CSS]]></category>
		<category><![CDATA[xhtml]]></category>

		<guid isPermaLink="false">http://www.csskarma.com/blog/?p=279</guid>
		<description><![CDATA[&#60;div align="center"&#62; is deprecated. It&#8217;s been deprecated for a long time, but it keeps creeping up for things like center aligning an image. Another popular way to do this is to wrap an extra div around the image and set the text alignment to center. This creates (as you might know, I hate), an added [...]]]></description>
			<content:encoded><![CDATA[<p><code>&lt;div align="center"&gt;</code> is <a rel="external" href="http://webdesign.about.com/od/htmltags/a/bltags_deprctag.htm">deprecated</a>.</p>
<p>It&#8217;s been deprecated for a long time, but it keeps creeping up for things like center aligning an image.</p>
<p>Another popular way to do this is to wrap an extra <code>div</code> around the image and set the text alignment to center. This creates (as you might know, I hate), an added layer of XHTML code that you really don&#8217;t need.</p>
<pre><code>.image-wrap{
text-align:center;
}</code></pre>
<p>This goes back to one of my pet peeves about using too many <code>divs</code>. Here&#8217;s what I came up with:</p>
<h5>CSS</h5>
<pre><code>#content-main img{
display:block;
width:auto;
margin:auto;
}</code></pre>
<p>That will center your image, and of course you can add a class in if you don&#8217;t want all your images centered.</p>
<p>Just a quick tip today, as I&#8217;m getting back into the swing of things after vacation. I hope everyone had a good holiday season.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.csskarma.com/blog/centering-an-image/feed/</wfw:commentRss>
		<slash:comments>6</slash:comments>
		</item>
		<item>
		<title>This Week in Links 12/2</title>
		<link>http://www.csskarma.com/blog/this-week-in-links-11/</link>
		<comments>http://www.csskarma.com/blog/this-week-in-links-11/#comments</comments>
		<pubDate>Mon, 08 Dec 2008 16:47:58 +0000</pubDate>
		<dc:creator>Tim</dc:creator>
				<category><![CDATA[News]]></category>
		<category><![CDATA[Web Development]]></category>
		<category><![CDATA[conference]]></category>
		<category><![CDATA[CSS]]></category>
		<category><![CDATA[jquery]]></category>

		<guid isPermaLink="false">http://www.csskarma.com/blog/?p=265</guid>
		<description><![CDATA[CSS Deployment 101 Reinhold Weber talks about how to compress a CSS file before you push it to the server. this will shave off some load time by reducing everything to one line and removing much of the white space. It also allows you to modularize your CSS without it effecting HTTP requests, because this [...]]]></description>
			<content:encoded><![CDATA[<p><img src="http://www.csskarma.com/images/articles/this-week-in-links.jpg" alt="article image"/></p>
<h5><a href="http://reinholdweber.com/?p=37" rel="external">CSS Deployment 101</a></h5>
<p>Reinhold Weber talks about how to compress a CSS file before you push it to the server. this will shave off some load time by reducing everything to one line and removing much of the white space. It also allows you to modularize your CSS without it effecting HTTP requests, because this script will also combine all files into one once it&#8217;s on the server.</p>
<h5><a href="http://www.cssnewbie.com/equal-height-columns-with-jquery/" rel="external">Equal Height Columns with jQuery</a></h5>
<p>A very useful bit of jQuery creating equal height columns. Pretty slick integration, I&#8217;ll be using this.</p>
<h5><a href="http://north.webdirections.org/" rel="external">Web Directions North</a></h5>
<p>Web Directions is a conference I went to last January, it was very cool. Possibly the best conference I&#8217;ve been to so far. It&#8217;s coming back this February in Denver; if you have the means, I highly recommend it.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.csskarma.com/blog/this-week-in-links-11/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Header and Footer in the Semantic Web</title>
		<link>http://www.csskarma.com/blog/header-and-footer/</link>
		<comments>http://www.csskarma.com/blog/header-and-footer/#comments</comments>
		<pubDate>Fri, 21 Nov 2008 04:16:57 +0000</pubDate>
		<dc:creator>Tim</dc:creator>
				<category><![CDATA[Web Development]]></category>
		<category><![CDATA[Web Standards]]></category>
		<category><![CDATA[andy clarke]]></category>
		<category><![CDATA[CSS]]></category>
		<category><![CDATA[semantics]]></category>
		<category><![CDATA[xhtml]]></category>

		<guid isPermaLink="false">http://www.csskarma.com/blog/?p=228</guid>
		<description><![CDATA[A couple years ago I read through Andy Clarke&#8217;s Transcending CSS and it really made me think about semantic naming conventions I had otherwise taken for granted. By now, most of us (at least people reading this blog) practice using semantic markup and meaningful class &#38; ID names. But can we do it better? Probably. [...]]]></description>
			<content:encoded><![CDATA[<p><img src="http://www.csskarma.com/images/articles/branding-and-header.jpg" alt="atricle banner" /></p>
<p>A couple years ago I read through <a rel="external" href="http://transcendingcss.com/">Andy Clarke&#8217;s Transcending CSS</a> and it really made me think about semantic naming conventions I had otherwise taken for granted. By now, most of us (at least people reading this blog) practice using semantic markup and meaningful class &amp; ID names. But can we do it better? Probably. There&#8217;s <em>always</em> room for improvement.</p>
<p>Andy&#8217;s book was (still is) filled with many techniques that I hadn&#8217;t seen before. I had fallen into the trap that many designer/developers fall into. I was doing things just because I had seen other others doing it and assumed it was the best way. This is why most people still use <code>&lt;div id="wrap"&gt;</code> even though it&#8217;s usually unnecessary.</p>
<p>I&#8217;m mainly talking about semantic <code>div</code> naming. Specifically &quot;header&quot; &amp; &#8220;footer&#8221;. I&#8217;ve had a while to think through this, so bear with me here.</p>
<h4>Basic semantics</h4>
<p>The basis of the semantic web is to look at content first, and then decide which element to use, based on that content. Using a list for navigation rather than a paragraph with line breaks (for a brutal example), using an <code>h2</code> instead of regular bold text, things like that.</p>
<p>Semantic elements extend beyond just XHTML, it extends into your class and ID names. We&#8217;ve all seen articles telling us to use names like &quot;error&quot;, rather than &quot;red&quot; and &quot;highlight&quot; rather than &quot;yellow&quot;. These names are more meaningful and leave room in the future changing the CSS behind them, while still keeping them meaningful.</p>
<p>The same principle should be applied to ID naming, but for some reason, it hasn&#8217;t fully taken off. We&#8217;re using names like &quot;header&quot;, &quot;footer&quot;, and &quot;sidebar&quot; in our every day development. On the surface they&#8217;re fine, but in the long run they can really hinder future design changes.</p>
<p>What information can be gathered from these <code>div</code> names?</p>
<h5>Header</h5>
<p>From the name alone, you can tell that this element is at the top of the page. From experience we can assume it also contains some kind of information about the site (name, logo, tagline, etc.). But it&#8217;s definitely at the top of the page.</p>
<h5>Footer</h5>
<p>Footer tells us this is located at the bottom of the page.</p>
<h5>Sidebar</h5>
<p>The name &quot;sidebar&quot; contains no information about what it contains, just that it runs along, either the right or left side of the page.</p>
<h5>The popular way</h5>
<pre><code>&lt;div id="header"&gt;&lt;/div&gt;
&lt;div id="nav"&gt;&lt;/div&gt;
&lt;div id="main"&gt;&lt;/div&gt;
&lt;div id="sidebar"&gt;&lt;/div&gt;
&lt;div id="footer"&gt;&lt;/div&gt;</code></pre>
<p>What if you want to put the logo somewhere else? Maybe your copyright and contact information isn&#8217;t stylish at the bottom of the page anymore? Or you just want to move that sidebar where your &quot;footer&quot; is? You&#8217;ll have to rework the markup, move code around and waste time. This takes a valuable function of out CSS, you should be able to completely redesign the layout of your site without touching the markup (unless you want to add stuff, of course). <strong>That&#8217;s the true power of CSS.</strong></p>
<h4>Advanced Semantics</h4>
<p>Andy Clarke proposed that we actually look at the content contained in these <code>divs</code> before give them labels and lock them into a role that could change in the future.</p>
<h5>Andy&#8217;s suggestion</h5>
<pre><code>&lt;div id="branding"&gt;&lt;/div&gt;
&lt;div id="nav"&gt;&lt;/div&gt;
&lt;div id="content"&gt;
  &lt;div id="content_main"&gt;&lt;/div&gt;
  &lt;div id="content_sub"&gt;&lt;/div&gt;
&lt;/div&gt;
&lt;div id="site_info"&gt;&lt;/div&gt;</code></pre>
<h5>My edits</h5>
<p>I&#8217;ve made some suggested changes to this code, I&#8217;ll get into the why of that in a little while, but for now, here&#8217;s how I changed it:</p>
<pre><code>&lt;div id="branding"&gt;&lt;/div&gt;<span>&lt;!--/branding--&gt;</span>
&lt;div id="nav"&gt;&lt;/div&gt;<span>&lt;!--/nav--&gt;</span>
&lt;div id="content"&gt;
  &lt;div id="content-main"&gt;&lt;/div&gt;<span>&lt;!--/content-main--&gt;</span>
  &lt;div id="content-sub"&gt;&lt;/div&gt;<span>&lt;!--/content-sub--&gt;</span>
&lt;/div&gt;<span>&lt;!--/content--&gt;</span>
&lt;div id="site-info"&gt;&lt;/div&gt;<span>&lt;!--/site-info--&gt;</span></code></pre>
<p>What information can we gather from these <code>div</code> names? (Let&#8217;s just look at the 3 we&#8217;re talking about)</p>
<h5>Branding</h5>
<p>Logo, tagline, topics, information and graphics that brand this as an individual can be found in a <code>div</code> named &quot;branding&quot;. Best of all, it gives no positioning&ndash;relevant information, so in the future (or present) this area can be moved and modified in any way. As long as the content stays meaningful to branding information (which is not usually something that changes in a redesign/realignment), all will be well on the web.</p>
<h5>Content-sub</h5>
<p>This is old &quot;sidebar&quot;; &quot;content-sub&quot; is labeled as secondary content, it can be positioned anywhere, and will most likely continue to be secondary information in relation to &quot;content-main&quot;. And both are contained in a <code>div</code> labeled as &quot;content&quot;. You can always add more elements in there like &quot;content-level-three&quot; to accommodate a growing site. But, I find that &quot;main&quot; and &quot;sub&quot; usually cover everything.</p>
<p>This will clean up your style sheet as well:</p>
<pre><code>#content{}
#content-main{}
#content-sub{}</code></pre>
<h5>Site-info</h5>
<p>&quot;Site-info&quot; replaces the old &quot;footer&quot;. The footer usually contains content about the site: archives, copyright, maybe a contact link, etc. And there&#8217;s no rule that says that information needs to be at the bottom of the page (there isn&#8217;t, I checked). It&#8217;s fine if it&#8217;s there, that&#8217;s where mine is, but in the future if you want to move it the <code>div</code> name will stay semantic and meaningful.</p>
<h4>The changes I made</h4>
<p>I made some changes to Andy&#8217;s code for a few reasons:</p>
<ul>
<li>I can never leave well enough alone.</li>
<li>I always close out my divs with a comment telling me which div got closed so there&#8217;s no confusion in the future.</li>
<li><strong>The underscores</strong>: I switched out the underscores with dashes because I came across an article about <a rel="external" href="http://devedge-temp.mozilla.org/viewsource/2001/css-underscores/">using underscores in CSS</a>.</li>
</ul>
<p>In old browsers the underscore in ID and class names had to be escaped like:</p>
<pre><code>p.urgent\_note {color: maroon;}</code></pre>
<p>Or there can be some bad layout problems. Now, this is a big &quot;Who give a crap&quot; in today&#8217;s web since no one uses these old browsers anymore, but I see it as a small change to my CSS to make it slightly more degradable just in case some strange user comes by. And it&#8217;s really no extra work to do this, which makes it even better.</p>
<h4>Closing</h4>
<p>I&#8217;ve been using this technique for a while now and I love it. When I did my last redesign, it was just a straight style sheet swap. I don&#8217;t know if anyone remembers what that looked like, but this is totally different. It was very simple, fast and I hope some readers out there give it a try.</p>
<p>Thoughts? Want to tell me I&#8217;m wrong? I&#8217;d love to here it.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.csskarma.com/blog/header-and-footer/feed/</wfw:commentRss>
		<slash:comments>18</slash:comments>
		</item>
		<item>
		<title>This Week in Links 10/27</title>
		<link>http://www.csskarma.com/blog/this-week-in-links-8/</link>
		<comments>http://www.csskarma.com/blog/this-week-in-links-8/#comments</comments>
		<pubDate>Mon, 27 Oct 2008 16:04:50 +0000</pubDate>
		<dc:creator>Tim</dc:creator>
				<category><![CDATA[News]]></category>
		<category><![CDATA[Web Development]]></category>
		<category><![CDATA[CSS]]></category>
		<category><![CDATA[finances]]></category>
		<category><![CDATA[font]]></category>
		<category><![CDATA[javascript]]></category>
		<category><![CDATA[jquery]]></category>
		<category><![CDATA[seo]]></category>
		<category><![CDATA[twitter]]></category>

		<guid isPermaLink="false">http://www.csskarma.com/blog/?p=213</guid>
		<description><![CDATA[Better CSS Font Stacks A good article on how to jazz up your stacks to try and take advantage of users who have more fonts installed. I&#8217;m all for this, and as long as it&#8217;s done carefully, can get a nice version of progressive enhancement. 5 Terrible SEO Ideas Richard Bradshaw goes over some trendy [...]]]></description>
			<content:encoded><![CDATA[<p><img src="http://www.csskarma.com/images/articles/this-week-in-links.jpg" alt="article banner"/></p>
<h5><a href="http://unitinteractive.com/blog/2008/06/26/better-css-font-stacks/" rel="external">Better CSS Font Stacks</a></h5>
<p>A good article on how to jazz up your stacks to try and take advantage of users who have more fonts installed. I&#8217;m all for this, and as long as it&#8217;s done carefully, can get a nice version of progressive enhancement.</p>
<h5><a href="http://www.bradshawenterprises.com/blog/2008/10/10/5-terrible-seo-ideas/" rel="external">5 Terrible SEO Ideas</a></h5>
<p>Richard Bradshaw goes over some trendy (and terrible) things that are common in SEO such as: keyword stuffing, dupe content, link farms, splash pages, and cloaking.</p>
<h5><a href="http://jqueryfordesigners.com/fun-with-overflows/" rel="external">Fun with Overflows</a></h5>
<p>I think this is a <strong>great</strong> idea (<a href="http://jqueryfordesigners.com/demo/scrollable-timelines.html" rel="external">check out the demo</a>). It creates a very similar interface to that of <a href="http://www.plurk.com" rel="external">Plurk</a>, the twitter competitor.</p>
<h5><a href="http://www.tweetwhatyouspend.com/" rel="external">Tweet What you Spend</a></h5>
<p>This is a pretty cool service that uses the Twitter API to track spending. I know it can seem kind of geeky (as is reading articles about CSS&#8230;), but tracking your spending is a great way to save money, it gives you a lot of power when you know exactly how your paycheck disappears every month. Provided you don&#8217;t mind sharing your expenses with the <a href="http://twitter.com/csskarma/" rel="external">Twitterverse</a>, this is a good service and very easy to use.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.csskarma.com/blog/this-week-in-links-8/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
	</channel>
</rss>
