<?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>Design Shack &#187; columns</title>
	<atom:link href="http://designshack.net/tag/columns/feed" rel="self" type="application/rss+xml" />
	<link>http://designshack.net</link>
	<description>Inspiration, CSS Gallery &#38; Community News</description>
	<lastBuildDate>Thu, 09 Feb 2012 06:00:00 +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>Introduction to CSS3 &#8211; Part 5: Multiple Columns</title>
		<link>http://designshack.net/articles/introduction-to-css3-part-5-multiple-columns/</link>
		<comments>http://designshack.net/articles/introduction-to-css3-part-5-multiple-columns/#comments</comments>
		<pubDate>Mon, 19 May 2008 16:19:22 +0000</pubDate>
		<dc:creator>David Appleyard</dc:creator>
				<category><![CDATA[Articles]]></category>
		<category><![CDATA[CSS]]></category>
		<category><![CDATA[columns]]></category>
		<category><![CDATA[css3]]></category>
		<category><![CDATA[layout]]></category>
		<category><![CDATA[multicolumn]]></category>
		<category><![CDATA[multiple]]></category>

		<guid isPermaLink="false">http://localhost:8888/?p=185</guid>
		<description><![CDATA[Multiple columns are a major facet of laying out text &#8211; newspapers have used them for decades. So important are they that it is amazing that the current way to achieve a multi column layout is one of the most complex techniques for a new designer to grasp. CSS3 introduces a new module known, appropriately, [...]]]></description>
			<content:encoded><![CDATA[<p>Multiple columns are a major facet of laying out text &#8211; newspapers have used them for decades. So important are they that it is amazing that the current way to achieve a multi column layout is one of the most complex techniques for a new designer to grasp.</p>
<p>CSS3 introduces a new module known, appropriately, as multi-column layout. It allows you to specify how many columns text should be split down into and how they should appear. As usual, examples can be found below:</p>
<p><a href="http://www.designshack.net/tutorialexamples/css3/css3examples.html" class="smallbox">View the live examples page</a></p>
<h2>Multiple columns using CSS3</h2>
<p>At present, this feature is available in Firefox and Safari 3. When the module becomes finalised in the CSS3 specification it will be adopted by other browsers and rolled into their updates.</p>
<p>There are four properties which relate to the multiple column layout in CSS3, allowing you to set the number of columns, width, gap between each column and a border between each:</p>
<ul>
<li>column-count</li>
<li>column-width</li>
<li>column-gap</li>
<li>column-rule</li>
</ul>
<p>At present, a browser specific selector is also needed to identify whether Safari or Firefox should display the selector. The code to be used to create a two column layout with a 1px rule between columns would be:</p>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
2
3
4
5
6
7
8
</pre></td><td class="code"><pre class="css" style="font-family:monospace;"><span style="color: #6666ff;">.multiplecolumns</span> <span style="color: #00AA00;">&#123;</span>
-moz-column-<span style="color: #000000; font-weight: bold;">width</span><span style="color: #00AA00;">:</span> <span style="color: #933;">130px</span><span style="color: #00AA00;">;;</span>
-webkit-column-<span style="color: #000000; font-weight: bold;">width</span><span style="color: #00AA00;">:</span> <span style="color: #933;">130px</span><span style="color: #00AA00;">;</span>
-moz-column-gap<span style="color: #00AA00;">:</span> <span style="color: #933;">20px</span><span style="color: #00AA00;">;</span>
-webkit-column-gap<span style="color: #00AA00;">:</span> <span style="color: #933;">20px</span><span style="color: #00AA00;">;</span>
-moz-column-rule<span style="color: #00AA00;">:</span> <span style="color: #933;">1px</span> <span style="color: #993333;">solid</span> <span style="color: #cc00cc;">#ddccb5</span><span style="color: #00AA00;">;</span>
-webkit-column-rule<span style="color: #00AA00;">:</span> <span style="color: #933;">1px</span> <span style="color: #993333;">solid</span> <span style="color: #cc00cc;">#ddccb5</span><span style="color: #00AA00;">;</span>
<span style="color: #00AA00;">&#125;</span></pre></td></tr></table></div>

<p><img src="http://www.designshack.net/postimages/multiplecolumns.png" alt="Multiple columns using CSS3" /></p>
<h2>Spanning columns</h2>
<p>It could also be the case that you would like an element to span more than one column &#8211; a heading, table or image for instance. This is facilitated in the specification through the use of:</p>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
2
3
</pre></td><td class="code"><pre class="css" style="font-family:monospace;">h2 <span style="color: #00AA00;">&#123;</span>
column-span<span style="color: #00AA00;">:</span> all
<span style="color: #00AA00;">&#125;</span></pre></td></tr></table></div>

<p>Numbers can also be used to allow the element to span a certain number of columns. At present this feature isn&#8217;t implemented in any major browsers, but should provide much needed additional flexibility when designing around this feature. It would allow you to achieve effects such as:</p>
<p><img src="http://www.designshack.net/postimages/multiplecolumns_heading.jpg" alt="Multiple column span using CSS3" /></p>
<h2>In the meantime</h2>
<p>It could still be a while before this feature is supported on enough systems to allow widespread use. A List Apart published in 2005 a <a href="http://www.alistapart.com/articles/css3multicolumn">JavaScript implementation of this capability</a> which allows you to use selectors in the same way and offers support in all major browsers. It should also degrade nicely when the feature is widely adopted and the JavaScript is no longer needed. It is a great interim solution if you&#8217;re desperate for multiple columns on your site.</p>
<h2>In conclusion&#8230;</h2>
<p>Multiple column layout will save a huge headache for many designers, allowing greater control of how copy is displayed. You can read the full specification for multi-column at the <a href="http://www.w3.org/TR/css3-multicol/">W3 site</a> if you&#8217;d like more information about the feature.</p>
<p>The next, and final, article in this series will be looking at the different background features available in CSS3 including using more than one background for an element, and specifying the size of backgrounds. Remember, to see live examples of these features, take a look at our <a href="http://www.designshack.net/tutorialexamples/css3/css3examples.html">CSS3 example page</a>.</p>
<h2>Other posts in the series</h2>
<ul>
<li><a href="http://designshack.net/tutorials/introduction-to-css3-part-1-what-is-it">Introduction to CSS3 &#8211; Part 1: What is it?</a></li>
<li><a href="http://designshack.net/tutorials/introduction-to-css3-part-2-borders">Introduction to CSS3 &#8211; Part 2: Borders</a></li>
<li><a href="http://designshack.net/tutorials/introduction-to-css3-part-3-text-effects">Introduction to CSS3 &#8211; Part 3: Text Effects</a></li>
<li><a href="http://designshack.net/tutorials/introduction-to-css3-part-4-user-interface">Introduction to CSS3 &#8211; Part 4: User Interface</a></li>
<li><a href="http://designshack.net/tutorials/introduction-to-css3-part-5-multiple-columns">Introduction to CSS3 &#8211; Part 5: Multiple Columns</a></li>
<li><a href="http://designshack.net/tutorials/introduction-to-css3-part-6-backgrounds">Introduction to CSS3 &#8211; Part 6: Backgrounds</a></li>
</ul>
]]></content:encoded>
			<wfw:commentRss>http://designshack.net/articles/introduction-to-css3-part-5-multiple-columns/feed/</wfw:commentRss>
		<slash:comments>36</slash:comments>
		</item>
	</channel>
</rss>

<!-- Performance optimized by W3 Total Cache. Learn more: http://www.w3-edge.com/wordpress-plugins/

Minified using disk: basic
Page Caching using disk: enhanced
Object Caching 203/219 objects using disk: basic

Served from: designshack.net @ 2012-02-09 21:10:40 -->
