W3C home > Mailing lists > Public > www-style@w3.org > January 2008

RE: Alignment property proposal

From: Alex Mogilevsky <alexmog@exchange.microsoft.com>
Date: Fri, 4 Jan 2008 19:45:24 -0800
To: "www-style@w3.org" <www-style@w3.org>
Message-ID: <04F36FB4ED0F85459AA447F72711526F012126B3675B@DF-GRTDANE-MSG.exchange.corp.microsoft.com>

I'd like to add a few notes on "alignment" proposals:

First, I have mixed feelings on the goals of the new property. It appears to have multiple reasons to exist:

1) Make it possible to model behavior of <CENTER>
2) Provide a more intuitive alternative to "margin:auto"
3) Enable alignment modes that are not possible in CSS2.1 ("true center", "vertical center")

(1) is certainly needed for a CSS-based layout engine in order to implement commonly used HTML elements. I believe it is an implementation detail though and it is fine to keep it proprietary. CSS positioning model is different from HTML. That's fine - as long as the same visual effect is achievable by its own model, CSS doesn't need to include a superset of features from other models. This part of argument isn't all that valuable for the author.

The only advantage I see in standardizing a property that implements <CENTER> is that then it can be strictly defined and interoperable (and therefore the meaning of <CENTER> is consistent everywhere, which it isn't now).

(2) sounds slightly more reasonable. "margin:auto" is not easily discoverable. However, if we expect authors to learn about margin collapsing, would it really help to add yet another way to center?

(3) is actually a good argument. But it doesn't have to be done with the same property that targets a deprecated HTML element.

Here is my thinking:

A. I like the approach of "text-align:block-center" (mentioned by Anne). I like it because
        * text-align inherits (and <CENTER> needs inheritance)
        * there is no issue of how 'text-align:left' interferes with 'block-align:center'
        * the value can be defined as a precise equivalent of <CENTER>

B. "true center" and vertical centering are great features to add.
        * vertical-align already exists. Why not take same approach and define "vertical-align:block-middle" which applies to everything, not just table cells?
        * similarly, "text-align:true-center" and "vertical-align:true-middle" would give the desired behavior without adding more properties to interfere with...

C. I actually happen to like the idea of "float:center". I'll write about that separately.

Yes, I know I contradict Markus here who started the thread. We are in the same company and could have agreed first. But we prefer open discussions now, don't we? :)

-- Alex
Received on Saturday, 5 January 2008 03:45:43 UTC

This archive was generated by hypermail 2.3.1 : Monday, 2 May 2016 14:27:32 UTC