IE10 flexbox widths include padding, causing overflow. box-sizing: border-box doesn't fix

前端 未结 5 1586
离开以前
离开以前 2021-02-01 02:49

The LHS flex child in this example has 1em padding, and it will cause RHS to overflow the parent:

5条回答
  •  盖世英雄少女心
    2021-02-01 03:26

    The issue appears to be the value for -ms-flex-negative: 0 on the box that has the padding, if this is set to 1, it appears to work.

    The background of RHS will now remain within the box, however its content won't, although it's the same with LHS. Adding max-width: 100% to LHS fixes that, but not on RHS, but adding word-break: break-all then causes the content to break and remain within the RHS box.

    Fiddle

    Is this what you want?

提交回复
热议问题