New Feature: Playlist Center! Pick a topic and let our playlists guide the way.

Easy-to-follow video tutorials help you learn software, creative, and business skills.Become a member

Preparing CSS3 multiple-column layout

From: Typography with CSS in Dreamweaver

Video: Preparing CSS3 multiple-column layout

One of the key advantages print designers have held over their web counterparts is the ability to easily lay out text in multiple columns. If you ever worked in a layout program like Adobe InDesign, you know how simple it is to flow text from one frame to another. Now thanks to CSS3 web designers can quickly set up any number of columns in their web pages and the text will flow just as easily and automatically. To show you how this looks, take a look at the page here and this is done without multicolumns, but now if I switch to the final completed page, here you can see the two columns side by side, and this is done with one simple CSS rule.

Preparing CSS3 multiple-column layout

One of the key advantages print designers have held over their web counterparts is the ability to easily lay out text in multiple columns. If you ever worked in a layout program like Adobe InDesign, you know how simple it is to flow text from one frame to another. Now thanks to CSS3 web designers can quickly set up any number of columns in their web pages and the text will flow just as easily and automatically. To show you how this looks, take a look at the page here and this is done without multicolumns, but now if I switch to the final completed page, here you can see the two columns side by side, and this is done with one simple CSS rule.

So let me show you how that works. The first thing I want to do is place these two columns in a single div and to do that, I'm going to go ahead and switch out of Live View and then go down to where the Tour vouchers start. The first step is to wrap the two paragraphs, Tour vouchers and Trip planning, into a single div. So I'm going to go into Split view here to make sure that I get both of those paragraphs, starting with each of the h3 tags. So I have Tour vouchers in the first paragraph and I'm scrolling down.

I now have Trip planning and I want to end it before Tour checklist. So now with that selected, I can press Command+T on the Mac or Ctrl+T on the PC, and you can see the wrap tag that jumped to the top of the screen there. This is the Quick Tag Editor and now I'm ready to put in my div and give it a special ID of multiple columns. Once I have that complete, just hit Enter or Return and there is my wrapping tag.

So now we are ready to create our new CSS rule and to do that, I'm going to go to main.css and I'll just scroll down to the bottom and start a new entry, with the hash mark and the ID multipleCols for multiple columns, put in my opening curly brace and my closing curly brace. The first thing I want to do is align the text to the left just to make sure that that is set up properly. Now you could do text-align justify which is a very common technique, but only, I think, if your entire page is using justified text.

Next we're going to put in vendor- specific tags for three different properties; column-count, column-gap, and column -rule and we'll do it for both the Mozilla and Webkit. So we'll start out by putting in a hyphen which indicates a vendor-specific prefix, and then we'll use moz for Mozilla followed by another hyphen and then the keywords column and you can see as we just put in the C, code hints goes right to column-count. So I'll go ahead and hit Enter and we have two columns here, and I'll close that off with a semicolon and another vendor-specific preference of moz, C for columns, and this time we want to do the column-gap, that's the area between the two columns and I'm going to make that 1. 5 em, and then finally the last and moz with another column property and this time column-rule, which is the straight line between the two columns.

This follows the syntax of CSS borders, so you put in the Width which is going to be 1 pixel, the Type which is solid, and then the Color, and I have a color value that I've picked up from elsewhere on the page. So it's c4c8cc. Press Return. Now we have the Mozilla rules; let's add in the Webkit ones. So -web, and then I can go ahead and hit Return for code hints to complete it, and again C for columns. This time I'm going to scroll down a little bit till I get to column-count and again, that's 2.

Repeat that Webkit column and this time we'll do column-gap 1.5 em. The final one, webkit-column-rule and again, we'll keep this same as we have with Mozilla. So 1 pixel, solid, and then the color value of c4c8cc. Let's make sure that we closed off our CSS rule. We did. So let's take a look in Design view, you'll notice that there is no significant change at all, but if we go into Live view and scroll down, you'll see our two columns automatically taking shape.

The ability to specify multiple columns in CSS is a real boon for web designers, as the feature greatly expands the layout possibilities.

Show transcript

This video is part of

Image for Typography with CSS in Dreamweaver
Typography with CSS in Dreamweaver

36 video lessons · 7997 viewers

Joseph Lowery
Author

 
Expand all | Collapse all
  1. 3m 52s
    1. Welcome
      1m 19s
    2. Using the exercise files
      2m 33s
  2. 19m 16s
    1. Working with the Property inspector's HTML tab
      2m 0s
    2. Making the most of the Property inspector's CSS tab
      4m 57s
    3. Defining and changing type with the CSS Rule Definition dialog
      6m 16s
    4. Modifying type directly in the CSS Styles panel
      6m 3s
  3. 19m 45s
    1. Understanding type measurement unit options
      2m 50s
    2. Working with pixels
      2m 34s
    3. Defining a percentage-based page with ems
      6m 51s
    4. Letting users set page type size
      7m 30s
  4. 17m 36s
    1. Getting to know the basic font categories
      1m 32s
    2. Employing web-safe fonts
      3m 20s
    3. Defining new font families
      3m 22s
    4. Exploring CSS3 typeface options
      3m 9s
    5. Setting up @font-face
      6m 13s
  5. 9m 39s
    1. Dispelling the myth of web-safe colors
      1m 13s
    2. Applying color to type
      4m 52s
    3. Incorporating semi-transparent type
      3m 34s
  6. 19m 46s
    1. Setting the font-weight
      3m 48s
    2. Mandating font case
      2m 25s
    3. Exploring font variants
      1m 50s
    4. Utilizing white space effectively
      3m 40s
    5. Changing letter and word spacing
      2m 20s
    6. Defining first-line variations
      2m 19s
    7. Inserting drop caps
      3m 24s
  7. 20m 17s
    1. Applying CSS3 text effects
      5m 26s
    2. Designing type gradients
      8m 27s
    3. Rotating text with CSS transform
      6m 24s
  8. 15m 21s
    1. Implementing advanced headings with HTML5
      3m 11s
    2. Preparing CSS3 multiple-column layout
      4m 50s
    3. Future type: Defining CSS Regions
      7m 20s
  9. 24m 51s
    1. Styling unordered lists
      6m 51s
    2. Specifying a sequence with ordered lists
      5m 14s
    3. Applying definition lists
      7m 19s
    4. Targeting list items with CSS3 nth child
      5m 27s
  10. 20s
    1. Next steps
      20s

Start learning today

Get unlimited access to all courses for just $25/month.

Become a member
Sometimes @lynda teaches me how to use a program and sometimes Lynda.com changes my life forever. @JosefShutter
@lynda lynda.com is an absolute life saver when it comes to learning todays software. Definitely recommend it! #higherlearning @Michael_Caraway
@lynda The best thing online! Your database of courses is great! To the mark and very helpful. Thanks! @ru22more
Got to create something yesterday I never thought I could do. #thanks @lynda @Ngventurella
I really do love @lynda as a learning platform. Never stop learning and developing, it’s probably our greatest gift as a species! @soundslikedavid
@lynda just subscribed to lynda.com all I can say its brilliant join now trust me @ButchSamurai
@lynda is an awesome resource. The membership is priceless if you take advantage of it. @diabetic_techie
One of the best decision I made this year. Buy a 1yr subscription to @lynda @cybercaptive
guys lynda.com (@lynda) is the best. So far I’ve learned Java, principles of OO programming, and now learning about MS project @lucasmitchell
Signed back up to @lynda dot com. I’ve missed it!! Proper geeking out right now! #timetolearn #geek @JayGodbold

Are you sure you want to delete this note?

No

Thanks for signing up.

We’ll send you a confirmation email shortly.


Sign up and receive emails about lynda.com and our online training library:

Here’s our privacy policy with more details about how we handle your information.

Keep up with news, tips, and latest courses with emails from lynda.com.

Sign up and receive emails about lynda.com and our online training library:

Here’s our privacy policy with more details about how we handle your information.

   
submit Lightbox submit clicked
Terms and conditions of use

We've updated our terms and conditions (now called terms of service).Go
Review and accept our updated terms of service.