ArtsAutosBooksBusinessEducationEntertainmentFamilyFashionFoodGamesGenderHealthHolidaysHomeHubPagesPersonal FinancePetsPoliticsReligionSportsTechnologyTravel
  • »
  • HubPages Tutorials and Community

Squidoo CSS: multi-column text

Updated on May 19, 2014

CSS3 multiple columns

You can divide long text snippets into multiple columns with a simple CSS trick. It's not difficult, and it can be customized in a plenty of ways.

In this lens I'll show you how to do it, step by step. You don't need any knowledge of HTML or CSS. I'll also discuss why this CSS trick can be useful.

Preview

This text is divided into two columns. You can divide text into more columns as well: three, four, five, and so on. If you are applying this CSS trick into your Squidoo lens, I recommend using no more than three columns. Too many columns look ugly and the text will become unreadable.

See the grey line between the columns? You can change its thickness, its color, its style, and you can completely get rid of it. I'll show you later how.

Can't see any columns but just one big piece of text? Then you are most probably using an outdated web browser. I recommend getting a newer one. Modern browsers are not only free, but they also provide better functionality, more pleasant browsing experience, and more advanced protection against security risks. I recommend getting either Google Chrome (my choice) or Mozilla Firefox (this is good as well). They are both free.

So, if you can't see any columns, click here to see a picture how this text should look like.

How: the basics

Below is a basic code for two column CSS code. If you want to immediately deploy this CSS trick, please feel free to do so. However, if you want to know how to modify it, please continue reading this lens.

Copy the code snippet below and paste it into your module. Change only the text that is green in the code snippet below.

Your text here. Don't change the blue text. Only green.

How: number of columns

Change the red numbers below to change the number of columns. By default the number is two. You can try three and even four, but please, don't be greedy. A five column paragraph doesn't look good.

2

; -moz-column-gap: 40px; -moz-column-rule: 1px solid #c4c8cc; -webkit-column-count: 2; -webkit-column-gap: 40px; -webkit-column-rule: 1px solid #c4c8cc; column-count: 2; column-gap: 40px; column-rule: 1px solid #c4c8cc;">Your text here. Don't change the blue text. Only green and red.

A five column paragraph doesn't look good.

Lorem ipsum dolor sit amet, consectetur adipiscing elit. Donec erat massa, dictum at viverra in, pulvinar non ipsum. Donec odio tortor, cursus eu facilisis id, sodales ac est. Mauris iaculis adipiscing nunc, a auctor justo tristique ut. Proin interdum nibh justo. Sed eget orci sit amet libero sollicitudin venenatis. Suspendisse tristique arcu sit amet massa convallis vitae tristique ligula faucibus. Integer vitae urna velit. Integer vestibulum orci sit amet eros interdum non eleifend dolor viverra. Ut consectetur libero mi. Ut vitae nunc nulla, id rhoncus purus.

How: the gap between columns

You can change the width of the gap between columns by changing the red text. By default it's 40 pixels, which is an ideal width.

40px

; -moz-column-rule: 1px solid #c4c8cc; -webkit-column-count: 2; -webkit-column-gap: 40px; -webkit-column-rule: 1px solid #c4c8cc; column-count: 2; column-gap: 40px; column-rule: 1px solid #c4c8cc;">Your text here. Don't change the blue text. Only green and red.

The gap between these paragraphs is now 20 pixels (20px). Lorem ipsum dolor sit amet, consectetur adipiscing elit. Suspendisse elementum, eros ac pretium condimentum, orci odio rhoncus augue, posuere fringilla ipsum diam fringilla augue. Curabitur nec pellentesque ante. Morbi iaculis lacus quis justo vulputate semper.

How: the line between columns

You can change the thickness, color, and style of the line between columns. You can also get rid of it. Change the red text like this:

  • 1Thickness

    Change the first value. By default it's 1px, you can try e.g. 3px.

  • 2Style

    Change the second value. By default it's solid, you can try e.g. dotted. Click here to see available styles.

  • 3Color

    Change the third value. By default it's #c4c8cc (light grey). Either write a name of a color (e.g. red or blue), or a hex color code (e.g. #f4656f (pink)). (Psst...be sure to check out my lens Funny Hex Colors.)

1px solid #c4c8cc

; -webkit-column-count: 2; -webkit-column-gap: 40px; -webkit-column-rule: 1px solid #c4c8cc; column-count: 2; column-gap: 40px; column-rule: 1px solid #c4c8cc;">Your text here. Don't change the blue text. Only green and red.

My gap line is 3px dashed #b59290. Lorem ipsum dolor sit amet, consectetur adipiscing elit. Suspendisse elementum, eros ac pretium condimentum, orci odio rhoncus augue, posuere fringilla ipsum diam fringilla augue. Curabitur nec pellentesque ante. Morbi iaculis lacus quis justo vulputate semper.

  • 4Getting rid of the line

    Remove the red text.

-moz-column-rule: 1px solid #c4c8cc;

-webkit-column-count: 2; -webkit-column-gap: 40px; -webkit-column-rule: 1px solid #c4c8cc; column-count: 2; column-gap: 40px; column-rule: 1px solid #c4c8cc;">Your text here. Don't change the blue text. Only green and red.

My gap doesn't have a line at all! Lorem ipsum dolor sit amet, consectetur adipiscing elit. Suspendisse elementum, eros ac pretium condimentum, orci odio rhoncus augue, posuere fringilla ipsum diam fringilla augue. Curabitur nec pellentesque ante. Morbi iaculis lacus quis justo vulputate semper.

That's a wrap!

Did you get it? Now you (should) know how to do the multi-column text CSS trick. Please vote below and please be honest. If you have questions, be sure to ask me. There's a guestbook at the bottom of this lens.

Did you understand?

See results

Want more CSS?

The book below is a must for you if you want to learn CSS. If you want to, you'd better also learn HTML. CSS and HTML go together, hand in hand.

Was this CSS trick useful? Are you already using it? Link to your lens using this CSS trick below, and feel free to add other comments as well!

HTML is allowed, spamming is not. Comments are moderated.

Comment & show-off - Guestbook

    0 of 8192 characters used
    Post Comment

    • profile image

      squidooprincess2012 4 years ago

      amazing! i was able to finally improve one of my lenses. thanks. :)

    • latishaalford profile image

      latishaalford 4 years ago

      Yes, this was extremely helpful!

    • dogface lm profile image
      Author

      dogface lm 5 years ago

      @Susan300: Why, thank you! :)

    • Susan300 profile image

      Susan300 5 years ago

      Excellent resource!! Very clear instructions. ** Angel Blessed! ** :)

    • Millionairemomma profile image

      Millionairemomma 5 years ago

      Super helpful!

    • profile image

      anonymous 5 years ago

      Very helpful, thanks!!

    • rob-hemphill profile image

      Rob Hemphill 5 years ago from Ireland

      Very useful, I'll bookmark, thanks for sharing.

    • profile image

      megabu717 5 years ago

      Great tip. Certainly will use it. Thanks for sharing!

    • APackageAtTheDoor profile image

      APackageAtTheDoor 5 years ago

      This will come in handy. Thanks!!

    • Snakesmum profile image

      Jean DAndrea 5 years ago from Victoria, Australia

      This is a really useful tip - thanks!

    • profile image

      deanjohnsonfineart 5 years ago

      Hello dogface, I appreciate your instructions for how to install HTML codes for doing columns. Thanks for visiting my lens.

    • David Dove profile image

      David Dove 5 years ago

      Thanks for that, helps a non=techie.

    • ajgodinho profile image

      Anthony Godinho 5 years ago from Ontario, Canada

      Nice short and sweet tutorial on a CSS trick to manipulate the text to two columns...thanks!

    • goldenecho profile image

      Gale 6 years ago from Texas

      Great lens. I added it to my Squidoo Toolbox lens as this is something I may want to try some time. I need more CSS in my toolbox (on and off Squidoo) anyways!

    • goldenecho profile image

      Gale 6 years ago from Texas

      @dogface lm: Wow...I just tried this on one of my lenses that had a long list of items that I knew would look better in columns (https://hubpages.com/entertainment/podfanportals )...and I just had to come back to say how much I appreciate how you laid this lens out. I like how you used highlighting to explain each part of the code. It's so easy to use! Thanks again!

    • dogface lm profile image
      Author

      dogface lm 6 years ago

      @goldenecho: Thanks!

    • Gamganny profile image

      Gamganny 6 years ago

      Great tip Thank you.