<?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>Ben Ward &#187; css</title>
	<atom:link href="http://benward.me/blog/tags/css/feed" rel="self" type="application/rss+xml" />
	<link>http://benward.me</link>
	<description></description>
	<lastBuildDate>Mon, 26 Jul 2010 03:23:13 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.9.1</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<item>
		<title>CSS3 Advanced Layout</title>
		<link>http://benward.me/mint/feeder/?FeederAction=clicked&amp;feed=Articles+%28RSS2%29&amp;seed=http%3A%2F%2Fbenward.me%2Fblog%2Fcss3-advanced-layout&amp;seed_title=CSS3+Advanced+Layout</link>
		<comments>http://benward.me/mint/feeder/?FeederAction=clicked&amp;feed=Articles+%28RSS2%29&amp;seed=http%3A%2F%2Fbenward.me%2Fblog%2Fcss3-advanced-layout&amp;seed_title=CSS3+Advanced+Layout#comments</comments>
		<pubDate>Sun, 18 Dec 2005 19:16:58 +0000</pubDate>
		<dc:creator>Ben</dc:creator>
				<category><![CDATA[Ben Ward's Journal]]></category>
		<category><![CDATA[advanced-layout]]></category>
		<category><![CDATA[css]]></category>
		<category><![CDATA[css3]]></category>
		<category><![CDATA[hellyeah]]></category>
		<category><![CDATA[layout]]></category>
		<category><![CDATA[w3c]]></category>

		<guid isPermaLink="false">http://ben-ward.co.uk/?p=290</guid>
		<description><![CDATA[Can you say "Grids"?]]></description>
			<content:encoded><![CDATA[	<p><img class="splash" alt="" src="/media/splashes/grid.splash.png" /> Can you say &#8220;Grids&#8221;?</p>

	<p>Please don&#8217;t take this the wrong way but <span class="caps">CSS</span> layout as we know it today well frankly it sucks a bit. I mean, consider the grief we go through to get multi-column designs working? Hacking around with floats? Changing the order of our content to make it work just right?</p>

	<p>It&#8217;s more powerful than misusing <code>&lt;table /&gt;</code> once was (and obviously cross-device compatible, accessible and so forth), but you could have it so much better.</p>

	<p>Introducing the <a href="http://www.w3.org/TR/2005/WD-css3-layout-20051215/"><span class="caps">CSS3 </span>Advanced Layout Module</a>. It&#8217;s a working draft and it&#8217;s <strong>very</strong> open about the fact that there are a number of ways to make it all work. But it exists, that&#8217;s the main thing.</p>

	<p>Most interesting in the new module is what&#8217;s been called <a href="http://www.w3.org/TR/2005/WD-css3-layout-20051215/#template-based">Template Based Positioning</a>, which allows you to define grids. Grids have a slots, and you can place any element on the page into a slot. That&#8217;s content order independence covered, by the way.</p>

	<p>Here&#8217;s an example quoted from the draft (please note that I&#8217;ve reformatted the <span class="caps">CSS</span> for legibility):</p>

	<p><blockquote cite="http://www.w3.org/TR/2005/WD-css3-layout-20051215/#template-based">Here is how the <a href="http://www.csszengarden.com/?cssfile=/026/026.css&#38;page=0">zunflower</a> design of the Zen Garden could be done:</p>

<pre><code>#container { display: "abc" }

#intro {
  position: a;
  margin-right: -2em;
  box-shadow: 0.5em 0.5em 0.5em;
}

#supportingText {
  position: b;
  box-shadow: 0.5em 0.5em 0.5em
}

#linkList { position: c }</code></pre>
</blockquote>

	<p>If you read down the Templates draft you&#8217;ll notice that the syntax gets rather more advanced that than too, but this preferred syntax isn&#8217;t really too far removed from drawing the layout with <span class="caps">ASCII</span> art. Sounds a bit hacky, perhaps even silly but I think it&#8217;s a good move; it&#8217;ll be very easy to explain and grasp. Much similar than a reworked implementation of the <code>&lt;table&gt;&lt;tr&gt;&lt;td colspan="12"&gt;</code> syntax, certainly.</p>

	<p>Another couple of examples, this time mine. This means they might be wrong, but I think I understand it right. You&#8217;re very welcome to <a href="/wordpress/wp-content/themes/migration/style.css" title="Ben-Ward.co.uk Migration CSS">view the <span class="caps">CSS</span></a> of this page to see how the layout is done at the moment. In theory, layout could be reduced to this:</p>

<pre><code>body {
  display: "aa"
           "bc";
           "dd";
}

#header { position: a; }
#content { position: b; }
#sidebar { position: c; }
#footer { position: d; }</code></pre>

	<p>I hope you can see what I mean when I say that this might just be crazy enough to work. Grids can also be defined for other elements, not just the body (or html). For example, rather than floating the accompanying graphic that appears with my posts, I could (if I wanted) do this:</p>

<pre><code>#content .post {
  display: "@a"
           "@@";
}

#content .post img.splash {
  position: a;
}</code></pre>

	<p>@ represents any content that isn&#8217;t otherwise positioned in a named slot (so the image is placed in a and everything else in a post flows through the @s). The syntax is then further extended to specify widths on these slots (my examples above aren&#8217;t complete for rebuilding this site as widths would be divided equally).</p>

	<p>The benefit in this example over using a float is zero, unless I wanted to include the splash image somewhere else in my code than at the very top. But it has rather fancier applications that can be covered another day.</p>

	<p>This is a <strong>huge, huge, huge</strong> thing for <span class="caps">CSS</span>. Having a simpler and less quirk-prone layout model will make all of our lives easier, and should make <span class="caps">CSS</span> easier to learn as well. Once it&#8217;s implemented (yes, I know).</p>

	<p>There&#8217;s lots of work to be done, and obviously we&#8217;re a way off seeing an implementation (but if there&#8217;s demand I guess we may see something testable in medium-term Gecko or WebKit builds). Comments are welcome to the <a href="http://lists.w3.org/Archives/Public/www-style/latest"><span class="caps">CSS</span> public mailing list</a> as usual.</p>

	<p>(The accompanying image is <a href="http://www.flickr.com/photos/omnia_mutantur/60958970/">India</a> by <a href="http://flickr.com/photos/omnia_mutantur/">Omnia Mutantur</a> on <a href="http://flickr.com">Flickr</a>. Used with permission.)</p>
 ]]></content:encoded>
			<wfw:commentRss>http://benward.me/mint/feeder/?FeederAction=clicked&amp;feed=Articles+%28RSS2%29&amp;seed=http%3A%2F%2Fbenward.me%2Fblog%2Fcss3-advanced-layout&amp;seed_title=CSS3+Advanced+Layout/feed</wfw:commentRss>
		<slash:comments>7</slash:comments>
		</item>
	</channel>
</rss>
