Re: CSS3: margins

Bjoern Hoehrmann writes:
> * fantasai wrote:
> >http://www.w3.org/TR/2001/WD-css3-box-20010726/
> >  |
> >  |  'Margin-inside' and 'margin-outside' are aliases for 'margin-left'
> >  |  or 'margin-right', depending on the current medium:
> >  |    * in paged media [link], 'margin-inside' sets 'margin-left' for
> >  |      those parts of an element that fall on a right-hand page and
> >  |      'margin-right' for the parts on a left-hand page. 'Margin-outside'
> >  |       is the reverse.
> >  |    * in other media, 'margin-inside' is an alias for 'margin-left' and
> >  |      'margin-outside' for 'margin-right'.
> >  |  Note: "inside" refers to the side of a page close to the binding,
> >  |  "outside" to the side where the book opens.
> >  |
> >  | [Do we really need margin-inside & margin-outside, or is 'page:left'
> >  |  enough?]
> >
> >I think margin-inside/margin-outside would only be useful for
> >the outermost element in printed material.
> 
> I.e. they would only apply to the :root { } element, but I think it
> would be simpler to give margin-left/margin-right different semantics
> depending on the page setting as noted above.

One case where they are useful on non-root elements is the following:

    div.sidebar {float: outside; margin-inside: 1em}

> 
> >margin-start and margin-end would be very helpful, though. :)
> 
> I am note sure what these properties are supposed to define? Margins
> start at the border and end at margin <length>.

'margin-start' and 'margin-end' (I assume) would be aliases for
margin-{top,right,bottom,left} depending on the 'writing-mode'.
'margin-start' refers to the margin where you start to write a line
(i.e., left in left-to-right text).

XSL has something similar, in the form of 'padding-start' and
'padding-end', and maybe they are useful there, but I've never seen a
case where they would be useful in CSS. The idea is presumably that
you can specify margins that depend on the writing mode. But why do
you want to do that? If the text is in, say, Hebrew, you already know
that "start" = "right" and you can just use 'margin-right'. And in
mixed text, you cannot use them at all, because you'd want to keep the
same margins *independent* of the writing direction:

In picture (>>> is ltr text, <<< is rtl text):

    margin-                                                    margin-
    left                                                       right
    ------><--------------------------------------------------><-----
           >>>> >>>>>>>>> >>> >> >>>>>>>>> >>> >>>>>> >>> >>
           >>>>>>> >>>>>>> >> >>>>>>> >>>>> >>>>>>> >>>>>> >>>>
           >>> >>>>>>>> >>>>>> >>>>>>>>>> >>> >> >> 

             <<<< <<<<<<<<<< <<< << <<<<<<<<< <<< <<<<<< <<< <<
            <<<<<<< <<<<<<< << <<<<<< <<<<< <<<<<<< <<<<<< <<<<
                    <<< <<<<<<<< <<<<<<<<< <<<<<<<<<< <<< << << 

           >>>> >>>>>>>> >>> >> >>>>>>>>> >>> >>>>>> >>> >>
           >>>>>>> >>>>>> >> >>>>>>> >>>>> >>>>>>> >>>>>> >>>>
           >>> >>>>> >>>>>> >>>>>>>>>> >>> >> >> 


[1] Ad "aliases": they are not real aliases, because they cannot be
replaced at parse time. Instead, we'll need a rule to determine
whether the UA looks at 'margin-inside' or not. The last Box model WD
doesn't explain that yet, but I think we will need an initial value of
'auto' for 'margin-inside'. Only if the specified value is not 'auto'
will this property take the place of 'margin-left' (or right, as the
case may be). The way XSL resolves 'padding-start' is specific to XSL
and won't work in CSS.



Bert
-- 
  Bert Bos                                ( W 3 C ) http://www.w3.org/
  http://www.w3.org/people/bos/                              W3C/INRIA
  bert@w3.org                             2004 Rt des Lucioles / BP 93
  +33 (0)4 92 38 76 92            06902 Sophia Antipolis Cedex, France

Received on Wednesday, 17 October 2001 10:15:27 UTC