- From: Giovanni Campagna <scampa.giovanni@gmail.com>
- Date: Mon, 13 Apr 2009 11:01:12 +0200
- To: robert@ocallahan.org
- Cc: Andrew Fedoniouk <news@terrainformatica.com>, David Hyatt <hyatt@apple.com>, www-style <www-style@w3.org>
2009/4/13 Robert O'Callahan <robert@ocallahan.org>: > On Mon, Apr 13, 2009 at 2:09 PM, Andrew Fedoniouk > <news@terrainformatica.com> wrote: >> >> But why do you need that box-flex there? >> >> As far as I understand that is the case for the calc() then: >> >> #A { width: calc(200px + (100% - 300px) / 2); } >> #B { width: calc(100px + (100% - 300px) / 2); } >> >> Flexes are needed when you want to take intrinsic widths or min/max >> constraints into account. > > I don't think you can use percentages in calc() that way. Even if you could, > trying to write it out using calc that way requires knowing the desired > width and flex of all children to write the rule for each child. It would > totally fail if you don't know what the markup is. The only reason to use calc() is percentage, and percentages are supported for sure (I once asked about that sentence "when em units are computed", Bert answered that calc() computes to calc(<absolute> + <percentage>)). If you wanted to sum em and cm, or pt and px, you could do the calculation manually, since you know the conversion factors.
Received on Monday, 13 April 2009 09:01:52 UTC