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

Re: Alignment property proposal

From: Brad Kemper <brkemper@comcast.net>
Date: Sun, 30 Dec 2007 22:52:52 -0800
Message-Id: <305B2C0F-2229-411D-A3B8-07CA77D3CDCB@comcast.net>
Cc: Alan Gresley <alan1@azzurum.com>, fantasai <fantasai.lists@inkedblade.net>, Markus Mielke <mmielke@microsoft.com>, "www-style@w3.org" <www-style@w3.org>
To: Rossen Atanassov <ratan@windows.microsoft.com>


On Dec 26, 2007, at 9:07 PM, Rossen Atanassov wrote:

>
> If <CENTER> was to affect the element only and not be inherited,  
> then this is no different than margin:auto.

I kind of took that to mean that it effects only the element in terms  
of inheritance. CENTER is different from margin:auto in that the  
blocks within it are centered within the space of the CENTER element.  
One "CENTER" can effect the positions of multiple elements within it,  
even if they are just immediate children and grandchildren do not  
inherit. That makes it more powerful than auto margins.

The blocks within the CENTER can also have their own margins, which  
is nice.

> In fact we need a dual property here - one that affects the  
> aligment of the element itself and one that affects all nested  
> elements inside.

For the alignment of the element itself, auto margins seem to be  
fairly adequate.

> Hence block alignment can be thought of IN and OUT having the  
> following inheriting logic (excuse the pseudo code):
>
> element.block_align.out = element.parent.block_align.in
> if (element.block_align.in is defined) element.block_align.in =  
> defined value
> else element.block_align.in = element.block_align.out
>
> Now it is easy to see that if I set block_align:center to a element  
> (assuming we're LTR) the element itself will be aligned left, but  
> all nested elements will align center which is exactly what HTML's  
> <div align=center> (i.e. CENTER) was inteded to do.
>
> Rossen Atanassov
> ________________________________________
> From: www-style-request@w3.org [www-style-request@w3.org] On Behalf  
> Of Alan Gresley [alan1@azzurum.com]
> Sent: Wednesday, December 26, 2007 4:31 PM
> To: fantasai
> Cc: Markus Mielke; www-style@w3.org
> Subject: RE: Alignment property proposal
>
> fantasai wrote:
>
>> 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.**
>
>
> I believe it should only effect the element and should not be  
> inherited. <center> is inherited and does create the need to  
> overrule the alignment further down the document tree. I believe  
> the alignment property proposal should be considered as an option  
> along with float:center as I can see use cases for both.
>
> Alan
>
> http://css-class.com/
>
Received on Monday, 31 December 2007 06:53:11 GMT

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