W3C home > Mailing lists > Public > www-style@w3.org > November 2007

Re: Alignment property proposal

From: L. David Baron <dbaron@dbaron.org>
Date: Tue, 6 Nov 2007 10:42:10 -0500
To: "www-style@w3.org" <www-style@w3.org>, "w3c-css-wg@w3.org" <w3c-css-wg@w3.org>
Message-ID: <20071106154210.GA31238@ridley.dbaron.org>

On Tuesday 2007-11-06 07:15 -0800, Markus Mielke wrote:
> Proposal:
> It would actually be better to create a new property called:
> 
> ' alignment'
> Value:                                   left |center | right | inherit

This also needs to have 'start' and 'end'.

> Initial:                                    left

Initial should be 'start'.

> Applies to:                          All elements
> Inherited:                            Yes
> Percentages:                     N/A
> Media:                                  visual
> Computed value:             as specified
> 
> This property describes how the content boxes of the element are
> aligned. This property does not change the way text will align within
> an element. For text alignment see 'text-align'. Values have the
> following meaning:

I'd propose one substantive change:  I think that it should affect how
the element is aligned in its parent, not how the children are aligned
within the element.  Second, I'd defer to the formal definition of
computing heights and margins to define how it works -- and this
definition would make this (inherited) property weaker than auto
margins.

Thus I'd rewrite this as:

  This property describes how block boxes:
    1. without 'auto' side margins, and
    2. smaller than the width that would fit in their containing block
  are aligned within their containing block when they have no 'auto'
  margins.  This property aligns blocks by changing the margins that are
  used in the section on <a
  href="http://www.w3.org/TR/CSS21/visudet.html#Computing_widths_and_margins">computing
  widths and margins.

> left
>                 Aligned all element boxes to the left
> 
> center
>                 Center aligns all element boxes
> 
> right
>                 Aligns all element boxes to the right

I'd say:

left
    If neither 'margin-left' nor 'margin-right' is 'auto',
    'margin-right' is treated as 'auto', aligning the block to the left.

center
    When neither 'margin-left' nor 'margin-right' is 'auto', both are
    treated as 'auto', aligning the block in the center of its
    containing block.

right
    If neither 'margin-left' nor 'margin-right' is 'auto', 'margin-left'
    is treated as 'auto', aligning the block to the right.

start
    When 'direction' is 'ltr' ('rtl'), the same as 'left' ('right').

end
    When 'direction' is 'ltr' ('rtl'), the same as 'right' ('left').

-David

-- 
L. David Baron                                 http://dbaron.org/
Mozilla Corporation                       http://www.mozilla.com/
Received on Tuesday, 6 November 2007 15:42:22 GMT

This archive was generated by hypermail 2.2.0+W3C-0.50 : Monday, 27 April 2009 13:54:56 GMT