In following example .flex2 has 2 childs.
- 1 child - width: 300px
- 2 child - width: 100%
.b{
height: 50px;
}
.flex2{
margin-top: 20px;
display: flex;
.box{
background-color: blue;
width: 300px;
}
.box1{
background-color: purple;
width: 100%;
}
}
<div class="flex2">
<div class="box b">
box
</div>
<div class="box1 b">
box 1
</div>
</div>
Why width: 100% (2 child) compresses a bit 1 child block with width 300px?
I do understand that % of width depends on the parents block width, but still dont get it.
So, can someone explain to me, why 100% shifts block only a little bit?