Subscribe

RSS Feed | RSS Email | Twitter
 

Sponsors

 

Search / Categories

 

CSS3 Multiple Columns

Posted on January 16th, 2009 by Zen Elements 11 Comments

CSS 3 Multiple Columns

Use CSS 3 to create a set of columns on your website without having to assign individual layers and / or paragraphs for each column. Along with the +/- quick list of compatible browsers, this is a guide on doing just that…

Along with the multiple background images, this following CSS 3 is on my favourites list. I think there is a lot of great potential for this CSS and in ways more than just a news paper/magazine layouts too! If you have used this in a concept or your own personal website, please do link them below in a comment as I would love to see, as I’m sure many others would too.

Alert

Cross Brower Compatibility

The browser that best supports CSS 3 multiple columns is FireFox, Safari and Google Chrome, which means we will concentrate on using the -moz- and -webkit- prefix.

All articles in the CSS3 will be updated in light of future support & development.

CSS 3 Multiple Columns (Width)

One early risen morning, grass layden with dew, Alex awoke with a vision, he knew through and through. It was dark, it was steamy with a heart warming glow. The kettle went on and it’s coffee for all! Okay, so it is maybe not a master piece of a tale but I wanted something here that was not Lorem Ipsum! I think it worked. Coffee anyone?

The above paragraph is set to use CSS 3 multiple columns using the following…

  1. CSS 3 Multiple Columns (Width)
  2. #my_CSS3_id {
  3. text-align: justify;
  4. -moz-column-width: 15em;
  5. -moz-column-gap: 2em;
  6. -webkit-column-width: 15em;
  7. -webkit-column-gap: 2em;
  8. }

Current Browser Support (Tested, Jan 2009)

  • FireFox (3.0.5)
  • Google Chrome (1.0.154.36)
  • Internet Explorer (IE6, IE7, IE8…)
  • Opera (9.6)
  • Safari (3.2.1, Windows)

An example for those on alternative browsers not seeing multiple columns above..

CSS 3 Multiple Columns (Count)

One early risen morning, grass layden with dew, Alex awoke with a vision, he knew through and through. It was dark, it was steamy with a heart warming glow. The kettle went on and it’s coffee for all! Okay, so it is maybe not a master piece of a tale but I wanted something here that was not Lorem Ipsum! I think it worked. Coffee anyone?

The above paragraph is set to use three CSS 3 columns using the following…

  1. CSS 3 Multiple Columns (Count)
  2. #my_CSS3_id {
  3. text-align: justify;
  4. -moz-column-count: 3;
  5. -moz-column-gap: 1.5em;
  6. -moz-column-rule: 1px solid #dedede;
  7. -webkit-column-count: 3;
  8. -webkit-column-gap: 1.5em;
  9. -webkit-column-rule: 1px solid #dedede;
  10. }

Current Browser Support (Tested, Jan 2009)

  • FireFox (3.0.5)
  • Google Chrome (1.0.154.36)
  • Internet Explorer (IE6, IE7, IE8…)
  • Opera (9.6)
  • Safari (3.2.1, Windows)

An example for those on alternative browsers not seeing multiple columns above..

Zen Elements Blog | CSS3 Series

Thanks for reading,

Alex | Zen Elements


 
RSS
Facebook
StumbleUpon

Comments (11)

MattJanuary 22nd, 2009 at 1:58 am

‘Cross Brower Compatability’
‘… means we will concentraite’

Just some spelling mistakes I picked up on, :).

Good article! I look forward to CSS3 becoming more mainstream, hopefully soon!

Zen ElementsJanuary 22nd, 2009 at 3:57 pm

@Matt:
Nope. No such errors. Don’t know what you’re talking about.. *admits shyly* spelling was not a strong point in there.

Thanks for highlighting ;)

santiagoApril 14th, 2009 at 2:15 pm

this i fu$@!$# great =)
one question… what’s this for? -> column-rule: 1px solid #dedede;?
cheers

Zen ElementsApril 15th, 2009 at 9:29 am

@Santiage | Thank you, I’m glad you enjoyed this and I’m certainly looking forward to when it is greater support cross-browser.

The code you mentioned – colum-rule: 1px solid #dedede; – is to create a verticle border line between the columns. This I have found currently only to work well in Safari.

NicoMay 23rd, 2009 at 9:54 am

That’s great. I hate use php parsers to get nice looking columns like I would get with this simple code. But there is no other way with ~15% IE6 Users…

BenMay 24th, 2009 at 4:56 pm

Great little bit of tutoring there!

You might want to change the column width in the “by width” example to something smaller, like 10em. I don’t know what CSS reset (if any) you’re using, but on my Dell 2408 with FF3 the column width is wide enough for the text, and there’s only one column generated. Playing with Firebug, 15em makes two, while 10em makes three. :)

Just FYI…

Zen ElementsMay 24th, 2009 at 5:12 pm

@Ben | Thank you! The error will have snuck in after I did a little redesign of the blog a while back where I reduced the display width, thereby creating this slight hickup. Glad you enjoyed the tutorials and thank you for the heads up on that! Alex.

Gorenov.comJune 15th, 2009 at 7:40 pm

# Internet Explorer (IE6, IE7, IE8…)
# Opera (9.6)

I hope it will support soon.

HamdenDesignsJuly 2nd, 2009 at 6:33 pm

using it! love it!!

HelenJuly 20th, 2009 at 2:49 pm

It’s a pity that sites with much text and information, that could take advantage of this technique, are visited during office hours with unable browsers. Unfortunately it is difficult to get a fallback.

JoshNovember 29th, 2009 at 7:33 pm

I love this. I can already see so many uses for between the multiple sites that I manage. It’ll be nice when CSS3 is ratified and we can stop with the browser extensions and go with the real CSS3 properties.

Leave a comment

Your comment

top
  • Zen Elements on Facebook
  • Zen Elements on Flickr
  • Zen Elements on Twitter
  • Zen Elements RSS Feed

© Zen Elements Ltd. 2008. All Rights Reserved. Sitemap | CSS | XHTML | Terms & Conditions