Flexbox auto margins don't work with justify-content: center in IE

后端 未结 2 1053
故里飘歌
故里飘歌 2021-01-17 13:35

I have a table where a cell can contain a number of icons, as well as text. If icons are present, they appear to the left of the text. There are a couple of possible alignme

2条回答
  •  夕颜
    夕颜 (楼主)
    2021-01-17 14:36

    This work around of removing justify-content doesn't work for me. If you look at this example in IE11 you will see: Codepen example

    .wrapper {
        display: flex;
        align-items: center;
        justify-content: center;
        margin: 0 auto;
        width: 200px;
        height: 200px;
        background-color: white;
    }
    
    .item {
        margin: auto;
        width: 50px;
        height: 50px;
        background-color: red;
    }
    

提交回复
热议问题