Re: Alignment property proposal

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 =
> if ( is defined) =  
> defined value
> else = 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: [] On Behalf  
> Of Alan Gresley []
> Sent: Wednesday, December 26, 2007 4:31 PM
> To: fantasai
> Cc: Markus Mielke;
> 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:
>> 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

Received on Monday, 31 December 2007 06:53:11 UTC