<?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>Rubber Chicken Farm</title>
	<atom:link href="http://rubberchickenfarm.com/feed/" rel="self" type="application/rss+xml" />
	<link>http://rubberchickenfarm.com</link>
	<description>Not your average developer&#039;s blog</description>
	<lastBuildDate>Wed, 29 Aug 2012 14:34:49 +0000</lastBuildDate>
	<language>en-US</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.4.1</generator>
		<item>
		<title>HTML5 and CSS3: Baby Steps</title>
		<link>http://rubberchickenfarm.com/2012/02/17/html5-and-css3-baby-steps/</link>
		<comments>http://rubberchickenfarm.com/2012/02/17/html5-and-css3-baby-steps/#comments</comments>
		<pubDate>Fri, 17 Feb 2012 16:48:10 +0000</pubDate>
		<dc:creator>J Andrew Scott</dc:creator>
				<category><![CDATA[Web Design]]></category>
		<category><![CDATA[css3]]></category>
		<category><![CDATA[html5]]></category>

		<guid isPermaLink="false">http://rubberchickenfarm.com/?p=59</guid>
		<description><![CDATA[So you're ready to plunge into the brave new world of HTML 5, huh? Technically, the W3C working group started working on the HTML 5 standard in 2004 and released its first working draft in 2008. As of February 2012, no final specification exists. Eight years without a finished product doesn't sound particularly brave or new. On the upside, non-revolutionary changes are pretty easy to transition into. In fact, if your current markup is <em>strictly</em> HTML 4.01 compliant, then it is <em>mostly</em> HTML 5 compliant already.]]></description>
			<content:encoded><![CDATA[<p>So you&#8217;re ready to plunge into the brave new world of HTML 5, huh? Technically, the W3C working group started working on the HTML 5 standard in 2004 and released its first working draft in 2008. As of February 2012, no final specification exists. Eight years without a finished product doesn&#8217;t sound particularly brave or new. On the upside, non-revolutionary changes are pretty easy to transition into. In fact, if your current markup is <em>strictly</em> HTML 4.01 compliant, then it is <em>mostly</em> HTML 5 compliant already.</p>
<p>So we&#8217;re done, right?</p>
<p>Well, not exactly. As often happens, it&#8217;s actually the major browsers who are driving standardization. Fortunately for us, the big hitters are generally sticking to the W3C&#8217;s working draft, at least on the basics. So let&#8217;s start there.</p>
<h4>Part #1: <strike style="color: #999;">The Basics</strike> The Requirements</h4>
<p>Oh, wait! First things first. We need to change our HTML <code>&#038;lt!DOCTYPE&gt;</code> declaration. You <em>were</em> using one, right? Of course you were. If not, today&#8217;s a good day to start. Your old doctype probably looked something like this:</p>
<p><strong>HTML 4.01 DOCTYPE</strong><br />
<code class="block">&lt;!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd"&gt;</code></p>
<p>That&#8217;s pretty cumbersome. Imagine our joy to discover how simple the doctype looks:</p>
<p><strong>HTML 5 DOCTYPE</strong><br />
<code class="block">&lt;!DOCTYPE html&gt;</code></p>
<p>That&#8217;s a pretty bit of code we can live with. Now that we have that cleared up&#8230;</p>
<h4>Part #1: The Basics <em>(for real this time)</em></h4>
<p>As I said before, if your markup is strictly HTML 4.01 compliant, it&#8217;s already mostly HTML 5 compliant. The difference is all the new gadgets that HTML 5 offers. If you&#8217;ve been writing html for any length of time, then you&#8217;re familiar with ye olde <code>&lt;div&gt;</code> tag. In fact, you&#8217;ve probably used it for pretty much every block-level element ever. That&#8217;s about to change. HTML 5 offers us more intuitive semantics than the generic <code>&lt;div&gt;</code> for describing our content:</p>
<ul>
<li><code>&lt;header&gt;</code> for page, article, and section headers</li>
<li><code>&lt;footer&gt;</code> for page, article, and section footers</li>
<li><code>&lt;article&gt;</code> for the primary content blocks on a page</li>
<li><code>&lt;section&gt;</code> for portions of content in an article</li>
<li><code>&lt;aside&gt;</code> for supplementary content blocks on a page (think sidebars, etc)</li>
<li><code>&lt;nav&gt;</code> for navigation menus and the like</li>
</ul>
<p>Consider the following page:</p>
<p><strong>HTML 4.01 Markup</strong><br />
<code class="block">&lt;!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd"&gt;<br />
&lt;html&gt;<br />
	&lt;head&gt;<br />
		&lt;title&gt;Old-School Markup&lt;/title&gt;<br />
	&lt;/head&gt;<br />
	&lt;body&gt;<br />
		&lt;div class="header"&gt;<br />
			&lt;h1&gt;Welcome&lt;/h1&gt;<br />
		&lt;/div&gt;<br />
		&lt;div class="nav"&gt;<br />
			&lt;ul&gt;<br />
				&lt;li&gt;&lt;a href="/link/url/"&gt;Link Text&lt;/a&gt;&lt;/li&gt;<br />
				&lt;li&gt;&lt;a href="/link/url/"&gt;Link Text&lt;/a&gt;&lt;/li&gt;<br />
				&lt;li&gt;&lt;a href="/link/url/"&gt;Link Text&lt;/a&gt;&lt;/li&gt;<br />
				&lt;li&gt;&lt;a href="/link/url/"&gt;Link Text&lt;/a&gt;&lt;/li&gt;<br />
				&lt;li&gt;&lt;a href="/link/url/"&gt;Link Text&lt;/a&gt;&lt;/li&gt;<br />
			&lt;/ul&gt;<br />
		&lt;/div&gt;<br />
		&lt;div class="content"&gt;<br />
			&lt;div class="header"&gt;Lorem Ipsum&lt;/div&gt;<br />
			&lt;p&gt;Lorem ipsum dolor sit amet...&lt;/p&gt;<br />
			&lt;div class="section"&gt;<br />
				&lt;div class="header"&gt;Lorem Ipsum&lt;/div&gt;<br />
				&lt;p&gt;Lorem ipsum dolor sit amet...&lt;/p&gt;<br />
				&lt;p&gt;Lorem ipsum dolor sit amet...&lt;/p&gt;<br />
				&lt;p&gt;Lorem ipsum dolor sit amet...&lt;/p&gt;<br />
			&lt;/div&gt;<br />
			&lt;div class="section"&gt;<br />
				&lt;div class="header"&gt;Lorem Ipsum&lt;/div&gt;<br />
				&lt;p&gt;Lorem ipsum dolor sit amet...&lt;/p&gt;<br />
				&lt;p&gt;Lorem ipsum dolor sit amet...&lt;/p&gt;<br />
				&lt;p&gt;Lorem ipsum dolor sit amet...&lt;/p&gt;<br />
			&lt;/div&gt;<br />
		&lt;/div&gt;<br />
		&lt;div class="sidebar"&gt;<br />
			&lt;p&gt;Lorem ipsum dolor sit amet...&lt;/p&gt;<br />
		&lt;/div&gt;<br />
		&lt;div class="footer"&gt;<br />
			&lt;h4&gt;&amp;copy; 2012&lt;/h4&gt;<br />
		&lt;/div&gt;<br />
	&lt;/body&gt;<br />
&lt;/html&gt;</code></p>
<p>Pretty standard stuff here. Nothing is wrong with this <em>per se</em>, but all those <code>&lt;div&gt;</code>&#8216;s can be a bit ambiguous and the extra class names to differentiate them are taking up extra bandwidth. While that may not be a concern for desktop users with broadband, we also want to consider mobile users with slower 3G connections. More markup means longer load times and higher data fees. Nobody wants that. So, we update our markup like so:</p>
<p><strong>HTML 5 Markup</strong><br />
<code class="block">&lt;!DOCTYPE html&gt;<br />
&lt;html&gt;<br />
	&lt;head&gt;<br />
		&lt;title&gt;New-Fangled Markup&lt;/title&gt;<br />
	&lt;/head&gt;<br />
	&lt;body&gt;<br />
		&lt;header&gt;<br />
			&lt;h1&gt;Welcome&lt;/h1&gt;<br />
		&lt;/header&gt;<br />
		&lt;nav&gt;<br />
			&lt;ul&gt;<br />
				&lt;li&gt;&lt;a href="/link/url/"&gt;Link Text&lt;/a&gt;&lt;/li&gt;<br />
				&lt;li&gt;&lt;a href="/link/url/"&gt;Link Text&lt;/a&gt;&lt;/li&gt;<br />
				&lt;li&gt;&lt;a href="/link/url/"&gt;Link Text&lt;/a&gt;&lt;/li&gt;<br />
				&lt;li&gt;&lt;a href="/link/url/"&gt;Link Text&lt;/a&gt;&lt;/li&gt;<br />
				&lt;li&gt;&lt;a href="/link/url/"&gt;Link Text&lt;/a&gt;&lt;/li&gt;<br />
			&lt;/ul&gt;<br />
		&lt;/nav&gt;<br />
		&lt;article&gt;<br />
			&lt;header&gt;Lorem Ipsum&lt;/header&gt;<br />
			&lt;p&gt;Lorem ipsum dolor sit amet...&lt;/p&gt;<br />
			&lt;section&gt;<br />
				&lt;header&gt;Lorem Ipsum&lt;/header&gt;<br />
				&lt;p&gt;Lorem ipsum dolor sit amet...&lt;/p&gt;<br />
				&lt;p&gt;Lorem ipsum dolor sit amet...&lt;/p&gt;<br />
				&lt;p&gt;Lorem ipsum dolor sit amet...&lt;/p&gt;<br />
			&lt;/section&gt;<br />
			&lt;section&gt;<br />
				&lt;header&gt;Lorem Ipsum&lt;/header&gt;<br />
				&lt;p&gt;Lorem ipsum dolor sit amet...&lt;/p&gt;<br />
				&lt;p&gt;Lorem ipsum dolor sit amet...&lt;/p&gt;<br />
				&lt;p&gt;Lorem ipsum dolor sit amet...&lt;/p&gt;<br />
			&lt;/section&gt;<br />
		&lt;/article&gt;<br />
		&lt;aside&gt;<br />
			&lt;p&gt;Lorem ipsum dolor sit amet...&lt;/p&gt;<br />
		&lt;/aside&gt;<br />
		&lt;footer&gt;<br />
			&lt;h4&gt;&amp;copy; 2012&lt;/h4&gt;<br />
		&lt;/footer&gt;<br />
	&lt;/body&gt;<br />
&lt;/html&gt;</code></p>
<p>Not only is our new markup more readable, we&#8217;ve dropped our file size from 1155 bytes to 988 bytes. While that doesn&#8217;t sound like much, we&#8217;ve saved ourselves and our users almost 15% of the original bandwidth cost. Not bad for a few minutes&#8217; work.</p>
<p>So congratulations, you&#8217;re using HTML 5. Of course there&#8217;s a lot more to it than that. We haven&#8217;t touched on the new media elements like <code>&lt;audio&gt;</code> and <code>&lt;video&gt;</code>, or really nifty stuff like <code>&lt;canvas&gt;</code>, but one thing at a time. We&#8217;ll get there, I promise.</p>
]]></content:encoded>
			<wfw:commentRss>http://rubberchickenfarm.com/2012/02/17/html5-and-css3-baby-steps/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Responsive Web Design: Baby Steps</title>
		<link>http://rubberchickenfarm.com/2011/11/25/responsive-we-design-baby-steps/</link>
		<comments>http://rubberchickenfarm.com/2011/11/25/responsive-we-design-baby-steps/#comments</comments>
		<pubDate>Fri, 25 Nov 2011 17:53:29 +0000</pubDate>
		<dc:creator>J Andrew Scott</dc:creator>
				<category><![CDATA[Web Design]]></category>
		<category><![CDATA[css]]></category>
		<category><![CDATA[html]]></category>
		<category><![CDATA[mobile]]></category>
		<category><![CDATA[responsive]]></category>

		<guid isPermaLink="false">http://rubberchickenfarm.com/?p=11</guid>
		<description><![CDATA[So you're ready to take the plunge into responsive web design? Well hold on there, partner. Your enthusiasm is good but let's make sure we've done our homework, too. First things first, make sure you have the following development essentials:

<ul>
	<li>Fresh coffee: keep that enthusiasm going.</li>
	<li>Good music: creativity needs good mojo.</li>
	<li>A comfy chair: your backside will thank you.</li>
</ul>

Ready now? Ok, let's dive in.]]></description>
			<content:encoded><![CDATA[<p>So you&#8217;re ready to take the plunge into responsive web design? Well hold on there, partner. Your enthusiasm is good but let&#8217;s make sure we&#8217;ve done our homework, too. First things first, make sure you have the following development essentials:</p>
<ul>
<li>Fresh coffee: keep that enthusiasm going.</li>
<li>Good music: creativity needs good mojo.</li>
<li>A comfy chair: your backside will thank you.</li>
</ul>
<p>Ready now? Ok, let&#8217;s dive in.</p>
<h4>Step #1: Layout</h4>
<p>Whether you&#8217;re building a new site or rebuilding an old one, the page layout is critical to a solid responsive design. Some layouts will be more conducive to responsive design than others. Starting with a <a href="http://www.smashingmagazine.com/2007/04/14/designing-with-grid-based-approach/" title="Designing With Grid-Based Approach" target="_blank">grid-based layout</a> will give you a lot of flexibility. If you want something lighter weight, a simple floating-column layout will also work well. For reference, let&#8217;s start with a typical fixed-width, two-column layout:</p>
<figure>
<figcaption>layout.html</figcaption>
<pre><code data-language="html">&lt;!DOCTYPE html&gt;
&lt;html&gt;
	&lt;head&gt;
		&lt;title&gt;Fixed-Width, Two-Column Layout&lt;/title&gt;
		&lt;link rel="stylesheet" type="text/css" href="styles.css"&gt;
	&lt;/head&gt;
	&lt;body&gt;
		&lt;div id="page"&gt;
			&lt;header id="page-header"&gt;
				&lt;h1&gt;This is the header&lt;/h1&gt;
			&lt;/header&gt;
			&lt;div id="page-body"&gt;
				&lt;div id="content"&gt;
					&lt;h2&gt;This is the page content&lt;/h2&gt;
				&lt;/div&gt;
				&lt;div id="sidebar"&gt;
					&lt;h3&gt;This is the page sidebar&lt;/h3&gt;
				&lt;/div&gt;
			&lt;/div&gt;
			&lt;footer id="page-footer"&gt;
				&lt;h4&gt;This is the footer&lt;/h4&gt;
			&lt;/footer&gt;
		&lt;/div&gt;
	&lt;/body&gt;
&lt;/html&gt;
</code></pre>
</figure>
<p>You&#8217;ve probably noticed the use of HTML5. This isn&#8217;t strictly necessary, but it&#8217;ll put you in good position for implementing advanced features. Trust me, you&#8217;ll be glad you did it. Other than that, this is about as simple as it gets. Now, here&#8217;s the accompanying stylesheet:</p>
<figure>
<figcaption>styles.css</figcaption>
<pre><code data-language="css">html, body {
	background: #666;
}
h1, h2, h3, h4 {
	margin: 0px;
	padding: 10px;
}
#page {
	width: 1280px;
	margin: 20px auto;
}
#page-header {
	background: #069;
	color: #fff;
}
#page-footer {
	background: #069;
	color: #fff;
	font-size: smaller;
	text-align: center;
}
#page-body {
	overflow: hidden;
	background: #fff;
	color: #333;
}
#content {
	overflow: hidden;
	float: left;
	width: 960px;
}
#sidebar {
	overflow: hidden;
	float: right;
	width: 320px;
	background: #ccc;
}
</code></pre>
</figure>
<p>Still pretty straight-forward. The net result is a fixed-width page with the main content in the left-hand column and a sidebar on the right-hand column. Notice the <code>#content</code> and <code>#sidebar</code> elements have properties <code>float: left;</code> and <code>float: right;</code>, respectively. To move the sidebar to the left-hand column, you can simply switch the left and right floats. Be careful, though, not to switch the order of the html tags in the layout. The order will be important when we get to modifying the design for different screen sizes. Also notice the <code>overflow: hidden;</code> property on the <code>#page-body</code>, <code>#content</code>, and <code>#sidebar</code> elements will prevent the content from making a mess of our column widths. Ok, so far, so good.</p>
<h4>Step #2: Media Queries</h4>
<p>Now that we have our layout built, we&#8217;re ready to work a little voodoo. The key here is to choose the screen widths we want to adjust our layout for and implement them using the CSS <code>@media</code> element. For instance, if we want to design around the iPhone, the screen widths we&#8217;ll be dealing with are 320 pixels (portait) and 480 pixels (landscape). If we also include the iPad, we&#8217;ll also want to account for 768 pixels (portrait) and 1024 pixels (landscape). That means we now have four alternative screen widths to deal with, which will mean four media queries in our CSS. Let&#8217;s start with 1024 pixels, the widest layout and closest to our original width of 1280 pixels. We&#8217;ll add the following lines to our stylesheet:</p>
<figure>
<figcaption>styles.css <em>(continued)</em></figcaption>
<pre><code data-language="css">@media only screen and (min-width: 1024px) and (max-width: 1279px) {
	#page {
		width: 1024px;
	}
	#content {
		width: 768px;
	}
	#sidebar {
		width: 256px;
	}
}
</code></pre>
</figure>
<p>The first thing you should notice is the <code>min-width</code> and <code>max-width</code> properties in the media query. What this does is applies everything in the block as an override to our main stylesheet, but ONLY to screens with widths between 1024 pixels and 1279 pixels. Once the screen width reaches 1280 pixels, our media query no longer applies and our main stylesheet takes over. Try resizing your browser window and watch our layout snap back and forth between our two widths. Of course, once your screen width drops below 1024 pixels, the layout reverts to its default 1280 pixels. Obviously this isn&#8217;t what we want, so let&#8217;s fill in the rest of our alternative screen widths:</p>
<figure>
<figcaption>styles.css <em>(continued)</em></figcaption>
<pre><code data-language="css">@media only screen and (min-width: 768px) and (max-width: 1023px) {
	#page {
		width: 768px;
	}
	#content {
		width: 512px;
	}
	#sidebar {
		width: 256px;
	}
}
@media only screen and (min-width: 480px) and (max-width: 767px) {
	#page {
		width: 480px;
	}
	#content, #sidebar {
		float: none;
		width: 480px;
	}
}
@media only screen and (max-width: 479px) {
	#page {
		width: 320px;
	}
	#content, #sidebar {
		float: none;
		width: 320px;
	}
}
</code></pre>
</figure>
<p>There we go, all of our alternative screen widths are now accounted for. Notice that on our last media query, we only include a <code>max-width</code>. Leaving off the minimum width on our narrowest layout will apply that layout to anything smaller than 320 pixels, instead of the default layout. You should also notice that on the 480-pixel and 320-pixel layouts, we apply the <code>float: none;</code> property to the <code>#content</code> and <code>#sidebar</code> elements, as well as setting them both to the full page width. This will stack them on top of each other instead of laying them out side-by-side. Now, remember when I told you the order of elements in the HTML would become important? Here it is: if we had put the sidebar before the main content in our HTML because we wanted the sidebar on the left-hand side, we would end up with the sidebar above the main content in our smaller layouts. See? I told you so.</p>
<p>Now we can&#8217;t call it a day until somebody throws us a curveball. Today it&#8217;s the iPad. The iPad is going to pull a little prank on us by scaling its pixels and rendering our portrait layout, even in layout orientation. Fortunately for us, correcting this behavior is pretty simple. Adding the following element to the <code>&lt;head&gt;</code> section of <code>layout.html</code> will prevent pixel scaling and we can all go home happy.</p>
<figure>
<figcaption>layout.html <em>(continued)</em></figcaption>
<pre><code data-language="html">&lt;meta name="viewport" content="width=device-width, minimum-scale=1.0, maximum-scale=1.0"&gt;</code></pre>
</figure>
<p>So that&#8217;s that. Obviously, we could dig a whole lot deeper into responsive design, but for today we&#8217;re taking baby steps. Rome wasn&#8217;t built in a day and neither are great websites, but today you&#8217;ve taken your first steps into a brave new world. So give yourself a pat on the back and have some fun with your new tools.</p>
]]></content:encoded>
			<wfw:commentRss>http://rubberchickenfarm.com/2011/11/25/responsive-we-design-baby-steps/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
	</channel>
</rss>
