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

RE: [css3-flexbox] absolutely positioned flexbox items

From: Alex Mogilevsky <alexmog@microsoft.com>
Date: Thu, 5 Jan 2012 04:10:29 +0000
To: Tab Atkins Jr. <jackalmage@gmail.com>, Tony Chang <tony@chromium.org>
CC: "www-style@w3.org" <www-style@w3.org>
Message-ID: <D51C9E849DDD0D4EA38C2E539856928412DCA0EE@TK5EX14MBXC214.redmond.corp.microsoft.com>
We have resolved at TPAC that abspos items leave placeholders: http://lists.w3.org/Archives/Public/www-style/2011Nov/0711.html 

-----Original Message-----
From: Tab Atkins Jr. [mailto:jackalmage@gmail.com] 
Sent: Wednesday, January 04, 2012 11:50 AM
To: Tony Chang
Cc: www-style@w3.org
Subject: Re: [css3-flexbox] absolutely positioned flexbox items

On Wed, Jan 4, 2012 at 11:42 AM, Tony Chang <tony@chromium.org> wrote:
> I have some questions about the static position of position:absolute 
> flex items.
> The spec says, "If the element has two neighbors, its static position 
> in the main axis is exactly in the center of the packing space between 
> them when the flexbox is actually laid out."  This seems to only 
> matter for flex-pack:justify (the only way there's packing space 
> between items), but why the middle?  It's not hard to implement, but I 
> wasn't sure what the use case is. I would expect the static position 
> to just be immediately after the previous flex item.  E.g.:
> +------------------+
> |aaa bbb        ccc|
> +-------------------+
> Where bbb is a position:absolute flex item and aaa and ccc are flex 
> items that are being positioned by flex-pack:justify.  The spec would 
> do something
> like:
> +------------------+
> |aaa      bbb   ccc|
> +------------------+
> This doesn't seem that useful since bbb itself isn't centered, just 
> the left edge is in the center between aaa and ccc.

If you know the dimensions of the abspos item, you can fully center it with a negative margin.  Future improvements to the positioning model may may centering even easier.

However, it's mostly that way because it seemed potentially useful.

> I also think the static position when there are no neighbors (i.e., a 
> position:absolute flex item with no other flex items) is a bit 
> unexpected. I wouldn't expect flex-pack to change the static position.

This was meant to give it a similar position to the other cases, as if it was next to some zero-width neighbors, since flex-pack implicitly changes its position in those cases.  I'm not opposed to it ignoring flex-pack entirely, though.

Alex, any opinion?


Received on Thursday, 5 January 2012 04:10:59 UTC

This archive was generated by hypermail 2.4.0 : Friday, 25 March 2022 10:08:09 UTC