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

Re: positioned elements: center

From: Brad Kemper <brkemper@comcast.net>
Date: Tue, 8 Jan 2008 21:57:12 -0800
Message-Id: <51E440B2-FE7D-4F52-8846-53A77326B2F3@comcast.net>
Cc: CSS Style <www-style@w3.org>
To: fantasai <fantasai.lists@inkedblade.net>


On Jan 8, 2008, at 9:10 AM, fantasai wrote:

> Brad Kemper wrote:
>> On Jan 7, 2008, at 11:36 AM, fantasai wrote:
>>> There was a proposal for pretty much exactly this functionality  
>>> quite awhile
>>> ago, with slightly different syntax
>>>   http://lists.w3.org/Archives/Public/www-style/2004Jan/0218.html
>> That's pretty different from what I'm proposing. By the definition  
>> given, position:center is a whole new positioning scheme,  
>> concerned primarily with making sure the item is both vertically  
>> centered and horizontally centered.
>> What I proposed was a small, simple extension to position:absolute  
>> (and position:fixed, and perhaps position:relative), which would  
>> continue to work exactly as it did before, except that in addition  
>> to setting the position of one or more of the four edges of the  
>> object, you could set the position of the center of the object.
>> It would not break any fundamental design principals. It would not  
>> break incremental rendering, since positioned items are taken out  
>> of the flow.
>
> See http://lists.w3.org/Archives/Public/www-style/2008Jan/0168.html on
> incremental rendering.
>
> AFAICT your proposal and "position: center" don't have any fundamental
> differences aside from the syntax used to get various results and, in
> the less common cases, whether some results are possible. They are  
> both
> absolute-positioning schemes and share the same layout advantages and
> disadvantages.

 From what I read, position:center was only for centering, whereas  
with my proposal, any value usable for top, right, bottom, or left  
would also be usable with center.

Center is the noun with what I've proposed, and more like a verb with  
that one.

What I've proposed does not require an all new positioning scheme to  
be added to the spec, just a couple of paragraphs similar to what is  
already there for "top", and another short paragraph about the  
shorthand form.

What I've proposed would be much easier to finalize and implement,  
because it is a simple property very similar to 4 existing  
properties, not a fundamentally new positioning scheme.

What I've proposed also works with "position:fixed" (a huge  
advantage), and "position:relative" (probably less important, but  
adding to its understandability).

What I've proposed fits very nicely conceptually with the other  
"left", "right", "top", and "bottom", because like them, it describes  
the starting position on the element it is set on that is moved to  
some other location via standard positioning. It is extremely easy to  
understand, because it is better built upon what already exists.

>
> I think the position: center scheme is less clear on what happens when
> e.g. 'left' is 'calc(50% + 5em)'...

Unless I am missing something (its possible, I admit), there is no  
"left" that can be used with position:center (unlike every other  
value for "position" other than "static"). To my understanding, the  
positioning starts and ends once "position" is given a value of  
"center". If you change the value of "position" to something that  
"left" can be used with, then it no longer has a value of "center".

>
> ~fantasai
Received on Wednesday, 9 January 2008 05:58:07 GMT

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