Re: [css3-page][css3-multicol] margins at page or column breaks

Håkon Wium Lie <howcome@opera.com> wrote on 2009/01/09 23:09:50
> 
> Also sprach MURAKAMI Shinyu:
> 
>  > I think we need new properties such as the following:
>  > 
>  > Name: margin-before-conditionality, margin-after-conditionality
>  > Value: discard-at-break | discard | retain
>  > Initial: discard-at-break
>  > Inherited: no
>  > Applies to: block-level elements
>  > 
>  > The 'margin-before-conditionality' affects the leading margin
>  > (margin-top if block-progression is top-to-bottom) and the 
>  > 'margin-after-conditionality' affects the trailing margin 
>  > (margin-bottom if block-progression is top-to-bottom).
> 
> This looks complex, and I don't really like inter-dependent properties. 
> 
> Instead, I suggest encouraging authors to use 'padding' when if the
> don't want to see space discarded, and 'margin' otherwise.


'padding' cannot be used for space when the block has border and/or
background.

Example:

<style>
h1 {
  page-break-before: always;
  border: solid;
  padding: 1cm;
  background: lime;
  margin-top: 5cm;
}
</style>
<body>
  <h1>Chapter 1</h1>
  bla bla bla...
  <h1>Chapter 2</h1>
  bla bla bla...
</body>

According to the spec, the margin-top of "Chapter 1" is not discarded but
the margin-top of "Chapter 2" is discarded.
In this case, 'padding-top' cannot be used instead of 'margin-top'.
I think still 'margin-before-conditionality: retain' (or something
better) is needed here.

> 
>  > >  > 3. Margins at beginning of multi-column content will be set to zero?
>  > > 
>  > > No.
>  > ^^^^^
> 
>  > >  > 3. Margins at beginning of multi-column content will be set to zero?
>  > >  > Firefox=Yes
>  > >  > Safari=No
>  > >  > Prince=Yes
>  > >  > PDFreactor=? (multi-column not yet supported)
>  > > 
>  > > This should definitely be yes.
>  >                             ^^^^
>  > Correct?
> 
> As you can see, I'm torn :)
> 
> Following the principle above, I do think margins should be discarded
> in case of doubt -- my vote is yes.

I found the css3-multicol spec says a little different thing:

http://dev.w3.org/csswg/css3-multicol/#the-multi-column
    The top margin of the first element and the bottom margin of the
    last element will collapse with the margins of the multi-column
    element as per the normal rules for collapsing. 

This spec seems wrong. If as per the normal rules for collapsing, when
the multi-column element has border-top/bottom or padding-top/bottom,
the top margin of the first element and the bottom margin of the last
element will NOT collapse.

I think the multi-column element is similar to the table, where the top
margin of the first element and the bottom margin of the last element in
the table cell will not collapse with the margins of table itself.

Probably it should be changed to:
    The top margin of the first element and the bottom margin of the
    last element in the multi-column element will be set to zero.


BTW, margins at end of document will be set to zero? I cannot find this
in the css3-page spec but if margins should be discarded in case of
doubt, it may be yes.
I hope the spec will be clear anyway.

-- 
Shinyu Murakami
http://www.antennahouse.com
Antenna House Formatter
http://www.antenna.co.jp/AHF/en/

Received on Friday, 9 January 2009 17:18:26 UTC