<?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>James Wilding&#039;s Weblog &#187; css</title>
	<atom:link href="http://jameswilding.net/tag/css/feed/" rel="self" type="application/rss+xml" />
	<link>http://jameswilding.net</link>
	<description>Buddhist businessman, freelance web developer</description>
	<lastBuildDate>Sun, 05 Sep 2010 09:38:56 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.0.1</generator>
		<item>
		<title>How to write better CSS</title>
		<link>http://jameswilding.net/feeder/?FeederAction=clicked&amp;feed=Posts+%28RSS2%29&amp;seed=http%3A%2F%2Fjameswilding.net%2F2009%2F08%2F14%2Fhow-to-write-better-css%2F&amp;seed_title=How+to+write+better+CSS</link>
		<comments>http://jameswilding.net/2009/08/14/how-to-write-better-css/#comments</comments>
		<pubDate>Fri, 14 Aug 2009 08:00:10 +0000</pubDate>
		<dc:creator>James</dc:creator>
				<category><![CDATA[Uncategorized]]></category>
		<category><![CDATA[css]]></category>
		<category><![CDATA[html]]></category>

		<guid isPermaLink="false">http://jameswilding.net/?p=187</guid>
		<description><![CDATA[Well-written CSS is easier to read, easier to maintain, and generally less of a headache. But the key to better CSS isn&#8217;t in brackets and line breaks: it&#8217;s actually all about the HTML. CSS what-now? We all know about Cascading Style Sheets. The W3C calls CSS: a simple mechanism for adding style (e.g. fonts, colors, [...]]]></description>
			<content:encoded><![CDATA[<p>Well-written CSS is easier to read, easier to maintain, and generally less of a headache. But the key to better CSS isn&#8217;t in brackets and line breaks: it&#8217;s actually all about the HTML.</p>
<h3><span id="more-187"></span></h3>
<h3 style="font-size: 1.17em;">CSS what-now?</h3>
<p>We all know about Cascading Style Sheets. The W3C <a href="http://www.w3.org/Style/CSS/">calls CSS</a>:</p>
<blockquote><p>a simple mechanism for adding style (e.g. fonts, colors, spacing) to Web documents.</p></blockquote>
<p>A nice, clear definition which puts the focus on the important distinction between styles and documents.</p>
<p>Now, you already know not to put styling in your HTML (unless it&#8217;s within <code>style</code> attributes): <code>font</code>, <code>link</code>, <code>vlink</code> and other tags which directly styled documents have gone the way of tables-for-layout &#8212; keeping these anachronisms out of your markup will help you no end. But more than that, well-structured HTML will help you to write cleaner, more concise CSS.</p>
<h3>Let your markup lead the way</h3>
<p>A lot of people, when marking up a blog, will do something like this:</p>
<p>[html]<br />
&lt;html&gt;<br />
&lt;body&gt;</p>
<p>  &lt;h1&gt;My Cool Blog&lt;/h1&gt;</p>
<p>  &lt;div class=&quot;article&quot;&gt;<br />
    &lt;h2 class=&quot;title&quot;&gt;Lorum Ipsum&lt;/h2&gt;<br />
    &lt;p class=&quot;meta&quot;&gt;posted by John, 10/8/09&lt;/p&gt;</p>
<p>    &lt;div class=&quot;body&quot;&gt;<br />
      &lt;p&gt;&#8230;&lt;/p&gt;<br />
    &lt;/div&gt;<br />
  &lt;/div&gt;</p>
<p>&lt;/body&gt;<br />
&lt;/html&gt;<br />
[/html]</p>
<p>All well and good (and nicely semantic), but a lot of those classes aren&#8217;t actually necessary for CSS: it&#8217;s easy to stuff your markup full of classes and IDs, but in many cases the structure of the document itself will allow you to apply style rules just as easily.</p>
<h3>Look Ma! No classes!</h3>
<p>Try this on for size:</p>
<p>[html]<br />
&lt;html&gt;<br />
&lt;body&gt;</p>
<p>  &lt;h1&gt;My Cool Blog&lt;/h1&gt;</p>
<p>  &lt;div&gt;<br />
    &lt;h2&gt;Lorum Ipsum&lt;/h2&gt;<br />
    &lt;p&gt;posted by John, 10/8/09&lt;/p&gt;</p>
<p>    &lt;div&gt;<br />
      &lt;p&gt;&#8230;&lt;/p&gt;<br />
    &lt;/div&gt;<br />
  &lt;/div&gt;</p>
<p>&lt;/body&gt;<br />
&lt;/html&gt;<br />
[/html]</p>
<p>Now maybe your CSS brain is screaming &#8216;NO!&#8217;, but this will work just as well when it comes to CSS:</p>
<p>[css]<br />
h1 {<br />
  font: 20px helvetica;<br />
}</p>
<p>body &gt; div {<br />
  border-top: 1px solid #000;<br />
}</p>
<p>/* article titles */<br />
body &gt; div &gt; h2 {<br />
  color: red;<br />
}</p>
<p>/* article meta-data */<br />
body &gt; div &gt; p {<br />
  color: #ccc;<br />
}</p>
<p>body &gt; div &gt; div {<br />
  /* CSS for article bodies here */<br />
}<br />
[/css]</p>
<p>Maybe not the most attractive blog in the world, but those selectors work! See how we&#8217;re using descendant selectors to reflect the structure of our HTML? No need for classes or IDs, and the well-structured markup will give future developers a clue as to the relative importance of information inside the HTML document, too.</p>
<h3>In conclusion&#8230;</h3>
<p>Thinking carefully about the structure of information in your HTML will help your write clear, concise, well-structured markup <em>and</em> CSS. Try it!</p>
]]></content:encoded>
			<wfw:commentRss>http://jameswilding.net/2009/08/14/how-to-write-better-css/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>Bowline: Desktop Apps with Ruby</title>
		<link>http://jameswilding.net/feeder/?FeederAction=clicked&amp;feed=Posts+%28RSS2%29&amp;seed=http%3A%2F%2Fjameswilding.net%2F2009%2F08%2F07%2Fbowline%2F&amp;seed_title=Bowline%3A+Desktop+Apps+with+Ruby</link>
		<comments>http://jameswilding.net/2009/08/07/bowline/#comments</comments>
		<pubDate>Fri, 07 Aug 2009 18:13:21 +0000</pubDate>
		<dc:creator>James</dc:creator>
				<category><![CDATA[Uncategorized]]></category>
		<category><![CDATA[css]]></category>
		<category><![CDATA[html]]></category>
		<category><![CDATA[ruby]]></category>

		<guid isPermaLink="false">http://jameswilding.net/?p=149</guid>
		<description><![CDATA[Bowline is a Ruby GUI framework that allows you to build desktop applications using Ruby, HTML, CSS, and JQuery. Sounds interesting? I thought so too! Bowline works in combination with Titanium, which lets you: Use Web technologies to create rich applications for Windows, Mac and Linux from a single code base. I think Bowline looks [...]]]></description>
			<content:encoded><![CDATA[<p><a href="http://leadthinking.com/191-bowline-a-ruby-gui-framework">Bowline</a> is a Ruby GUI framework that allows you to build desktop applications using Ruby, HTML, CSS, and JQuery. Sounds interesting? I thought so too!</p>
<p><span id="more-149"></span></p>
<p>Bowline works in combination with <a href="http://www.appcelerator.com/products/titanium-desktop/">Titanium</a>, which lets you:</p>
<blockquote><p>Use Web technologies to create rich applications for Windows, Mac and Linux from a single code base.</p></blockquote>
<p>I think Bowline looks awesome. Desktop apps using Ruby, WebKit, HTML 5 &#8212; all the best stuff if you&#8217;re a web development geek like me.</p>
<p>It&#8217;s difficult to summarise how Bowline works (although it&#8217;s a little like <a href="http://rubyonrails.org/">Rails</a>), so I recommend that you read <a title="Bowline - A Ruby GUI Framework" href="http://leadthinking.com/191-bowline-a-ruby-gui-framework">the author&#8217;s blog post introducing the framework</a>. Let&#8217;s hope Bowline grows into a stable, mature framework that does for desktop apps what Rails has done for the web.</p>
]]></content:encoded>
			<wfw:commentRss>http://jameswilding.net/2009/08/07/bowline/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
