W3C home > Mailing lists > Public > www-style@w3.org > May 2010

Re: [css3-flex] calc(flex) and concept of free space.

From: Brad Kemper <brad.kemper@gmail.com>
Date: Mon, 31 May 2010 10:30:11 -0700
Cc: "Tab Atkins Jr." <jackalmage@gmail.com>, "Zack Weinberg" <zweinberg@mozilla.com>, <www-style@w3.org>
Message-Id: <5424BD43-6A3F-42A6-ADA8-08CD63BB3C9D@gmail.com>
To: "Andrew Fedoniouk" <news@terrainformatica.com>

On May 30, 2010, at 8:00 PM, Andrew Fedoniouk wrote:

> Anyway, tell me better what would be the width of inner div here:
> 
> <div width:1000px padding-left:1fx>
>   <div width:calc(500px + 1fx) />
> </div>
> 
> Something tells me it will get zero, correct?

The flex units are based on distributing the space of the children of flexboxes. So, even if these two DIVs had flexbox parents, they are two different generations, and the flex of one distributes space from a different pool than the other. So, the '1fx' of the outer DIV depends on how much space is available in its parent flexbox (if that is a 1000px, based on your other examples, then the padding would be 0). The 1fx on the inner DIV is meaningless unless the outer one is 'display:flexbox', otherwise it is distributing a 500px (1000 - 500) to itself.
Received on Monday, 31 May 2010 17:30:53 GMT

This archive was generated by hypermail 2.3.1 : Tuesday, 26 March 2013 17:20:27 GMT