Re: [css3-multicol] typos in the spec

Waldir Pimenta wrote:

 > My doubt is about the case when one defines both the width and the
 > number of columns. As it is, the spec says that the given column
 > width is actually used as a minimum width, and the number of colums
 > is completely ignored.

Not quite. When the available width is unknown, both 'column-width'
and 'column-count' will be honored. This is, e.g., the case for
floats.

 > I don't think this is an intuitive behavior; If I specify both
 > properties, I expect both of them to be respected, just like when I
 > set a the width of, say, a paragraph or a div. Google Chrome
 > currently behaves the way I expect it to, but unfortunately it's
 > against the spec. I would like to understand if that behavior was
 > explicitly chosen against, and why.

There was a discussion leading up to the current solution. One premise
is that one, by default, should have flexible pages that adapt to the
available space and try to use it. This sentiment is expressed in one
of the notes:

  The reason for making ‘column-width’ somewhat flexible is to achieve
  scalable designs that can fit many screen sizes. To set an exact
  column width, all length values (in horizontal text these are:
  ‘width’, ‘column-width’, ‘column-gap’, and ‘column-rule-width’) must
  be specified.

The advice at the bottom also goes if you want to set the exact number
and width of the colums; you need to specify the width of the multicol
element. Note that you don't have to to introduce any new elements in
the markup to achieve this as the multicol element is already there.
So, you could, e.g., say:

  .multicol {
     column-count: 2;
     column-width: 100px;
     column-gap: 10px
     width: 210px;
  }

... and all values will be honored.

(There's actually an error in the note: column rules don't take up
space, so setting 'column-rule-width' doesn't influence the column
widths.)

Cheers,

-h&kon
              Håkon Wium Lie                          CTO °þe®ª
howcome@opera.com                  http://people.opera.com/howcome

Received on Monday, 7 February 2011 21:12:01 UTC