There are two sets of rows displayed below.
The first row contains two items with a flex value of
1
and one item with a flex value of2
.The second row contains two items with a flex value of
1
.
As per the specification, 1A + 1B = 2A
However, when padding is taken into account, the total does not add up correctly as shown in the example below.
QUERY
How can the flexbox be adjusted to consider padding in its calculations so that the boxes align properly in the given example?
.Row{
display:flex;
}
.Item{
display:flex;
flex:1;
flex-direction:column;
padding:0 10px 10px 0;
}
.Item > div{
background:#7ae;
}
.Flx2{
flex:2;
}
<div class="Row">
<div class="Item">
<div>1A</div>
</div>
<div class="Item">
<div>1B</div>
</div>
<div class="Item Flx2">
<div>1C</div>
</div>
</div>
<div class="Row">
<div class="Item">
<div>2A</div>
</div>
<div class="Item">
<div>2B</div>
</div>
</div>