- From: Andrew Fedoniouk <news@terrainformatica.com>
- Date: Fri, 06 Jun 2008 09:54:44 -0700
- To: Anne van Kesteren <annevk@opera.com>
- CC: fantasai <fantasai.lists@inkedblade.net>, robert@ocallahan.org, dbaron@dbaron.org, www-style@w3.org
Anne van Kesteren wrote: > On Fri, 06 Jun 2008 18:06:24 +0200, Andrew Fedoniouk > <news@terrainformatica.com> wrote: >>>> How do flex-units interact with collapsing margins? E.g. >>>> <div style="overflow:auto; height:500px;"> >>>> <div style="height:1*; margin:1*;">Hello</div> >>>> <div style="height:2*; margin:2*;">Kitty</div> >>>> </div> >>>> How does that work? Allocating flex height first and then collapsing >>>> margins means the child divs don't fill the container. But trying to >>>> collapse margins before resolving the flex heights seems crazy. >>> I would collapse the adjacent flex margins so that 1* collapsing with >>> 2* becomes a 2* gap. Then distribute the remaining space accordingly. >> >> Correct. margin:1* collapse in the same way as margin:1em; > > What if one margin is in flex units and the other is 100px or something? > > In my implementation fixed value is serving role of minv constraint and flex value is treated normally - as a weight. I think this makes sense. Thus margin in between these two elements: <div style="height:1*; margin-bottom:20px">Hello</div> <div style="height:2*; margin-top:2*;">Kitty</div> will be flexible but always greater (or equal) than 20px. -- Andrew Fedoniouk. http://terrainformatica.com
Received on Friday, 6 June 2008 16:55:28 UTC