multiline-flexbox in IE11 calculating widths incorrectly?

前端 未结 4 685
粉色の甜心
粉色の甜心 2020-12-05 06:44

Seems IE11 doesn\'t calculate flex item widths properly if flex-wrap: wrap is used.

See http://jsfiddle.net/MartijnR/WRn9r/6/

The 4 boxes each h

4条回答
  •  北荒
    北荒 (楼主)
    2020-12-05 07:29

    I received an workaround on the Microsoft forum from Rob. See http://social.msdn.microsoft.com/Forums/ie/en-US/8145c1e8-6e51-4213-ace2-2cfa43b1c018/ie-11-flexbox-with-flexwrap-wrap-doesnt-seem-to-calculate-widths-correctly-boxsizing-ignored?forum=iewebdevelopment

    Setting a min-width and changing to flex:auto makes the boxes behave, maintaining their flexiness.

    See http://jsfiddle.net/MartijnR/WRn9r/23/ and below for a slightly more advanced example with the workaround:

    1
    2
    3
    4
    5
    section { display: -moz-webkit-flex; display: -webkit-flex; display: flex; -ms-flex-direction: row; -moz-flex-direction: row; -webkit-flex-direction: row; flex-direction: row; -ms-flex-wrap: wrap; -moz-flex-wrap: wrap; -webkit-flex-wrap: wrap; flex-wrap: wrap; width: 100%; box-sizing:border-box; margin:0; } .box { border: 1px solid black; background: #ccc; display: block; box-sizing: border-box; margin:0; -ms-flex: auto; -moz-flex: auto; -webkit-flex: auto; flex: auto; } .fifty { min-width: 50%; } .twentyfive { min-width: 25%; }

提交回复
热议问题