CSS Flexible Box Layout on iPad

前端 未结 1 374
遥遥无期
遥遥无期 2021-02-04 14:46

I\'m trying to get a very simple layout using the flex model working on iPad.

I have a containing div that is supposed to center the content divs.

The sample cod

相关标签:
1条回答
  • 2021-02-04 15:40

    You're missing some properties from the old 2009 draft (or have them named wrong). Your container CSS should look like this:

    http://cssdeck.com/labs/ci9imeed

    .container {
      width: 510px;
      height: 310px;
      background: red;
      display: -webkit-box;
      display: -moz-box;
      display: -ms-flexbox;
      display: -webkit-flex;
      display: flex;
      -webkit-box-pack: center;
      -moz-box-pack: center;
      -ms-flex-pack: center;
      -webkit-justify-content: center;
      justify-content: center;
      -webkit-box-align: center;
      -moz-box-align: center;
      -ms-flex-align: center;
      -webkit-align-items: center;
      align-items: center;
      border: 2px solid;
      padding: 5px;
      margin: 0;
    }
    

    Note, however, that none of the browsers with a 2009 Flexbox implementation (Android, older Safari, older Firefox) support wrapping.

    0 讨论(0)
提交回复
热议问题