Flexbox wraps last column of the first row in Safari

前端 未结 12 698
长发绾君心
长发绾君心 2020-11-30 18:52

The last column of the first row is wrapped to the next line when viewing in Safari, and some other iOS based browsers.

Safari:

12条回答
  •  猫巷女王i
    2020-11-30 19:37

    In case you are using display flex with flex-wrap i solved it applying a hight order to the before and after pseudo-elements of the row, so they position as the last elements.

    .row.flex_class {
        display: flex;
        flex-direction: row;
        flex-wrap: wrap;
    }
    .row.flex_class::before, .row.flex_class::after {
        order: 10;
    }
    

提交回复
热议问题