RE: Alignment property proposal

Thanks Fantasai.

-----Original Message-----
From: fantasai [mailto:fantasai.lists@inkedblade.net]
Sent: Tuesday, December 25, 2007 10:25 PM
To: Markus Mielke; www-style@w3.org
Subject: Re: Alignment property proposal

Markus Mielke wrote:
> *Problem:*
>
> Allow centering of content within a containing block. Today, we only
> have text-align: center available that only applies to text and inline
> elements. This makes general centering of elements (like images) really
> difficult.
>
> *Proposal: *
>
> It would actually be better to create a new property ...

I've written this up for the wiki here:
   http://csswg.inkedblade.net/ideas/centering
There are a number of open issues. I'll paste the summary below, with my
suggestions in **.

    - Whether the property affects the element's alignment within its parent
      or its descendants' alignment within itself.

        **Proposed that it should affect the element.**

    - What alignment possibilities are represented as values.
        - One set: left | center | right
        - Another set: left | center | right | start | end
        - A more complex set that includes top and bottom values that apply in
          vertical layout. (Such a set should allow specifying e.g. both top
          and left at the same time, where one takes effect in vertical text
          and the other in horizontal text.)
        - Any of the above sets with percentages as an added possibility.

        **Proposed that we adopt left|center|right|start|end, possibly adding
          on <percentage> which would behave as for background-position**
        (I don't see a use case for top/bottom that wouldn't be better solved
         with start/end.)

    - What the property is named. alignment is the working name. An alternative
      would be horizontal-align, to be consistent with vertical-align.

        **Proposed that we adopt 'horizontal-align'.**

    - Whether alignment triggered by this property is "true" alignment, or if
      it only affects blocks smaller than their containing block.
        - If the property triggers "true" alignment, then a value that triggers
          current behavior must be the default. The disadvantage of this is that
          most authors will not realize use of this property can cause their
          content to become inaccessible in some window configurations.
        - If the property does not trigger "true" alignment, then an additional
          keyword (or several keywords) could be defined to trigger true alignment
          (e.g. alignment: left vs. alignment: true left). In this case both
          alignment behaviors are possible, and the default behavior emphasizes
          accessibility.

        **Proposed that the default not be true alignment.**

    - How this alignment interacts with the current margin calculations.
      Possibilities include:
        - alignment trumps auto margins: auto margins are set to zero and then
          the box is aligned as specified.
        - alignment defers to auto margins: it only affects blocks without auto
          side margins. (Note that the default margin is '0'.)

        **Proposed that alignment defers to auto margins**

    - How alignment interacts with specified margins
        - alignment replaces specified side margins with auto as appropriate to
          effect specified alignment (which will effectively erase any specified
          fixed-size margins)
        - alignment shifts the margin box, leaving specified margins intact

        **Proposed that alignment does not erase specified margins**

~fantasai

Received on Wednesday, 26 December 2007 17:12:02 UTC