RE: Alignment property proposal

If <CENTER> was to affect the element only and not be inherited, then this is no different than margin:auto. 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. 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 Thursday, 27 December 2007 05:07:17 UTC