flexbox and wrap property

前端 未结 2 952
渐次进展
渐次进展 2020-12-01 23:07

I am developing and app with phonegap. I wanted to use the flexbox to layout some buttons in my main application area.

Can somebody explain why this http://jsfiddle.

相关标签:
2条回答
  • 2020-12-01 23:29

    display: -webkit-box;

    You probably meant -webkit-flex.

    0 讨论(0)
  • 2020-12-01 23:33

    You have quite a few things not quite right here. First, you're mixing old properties with new properties (display: -webkit-box is from the 2009 draft, but -webkit-flex-flow is from the standard draft).

    Second, none of the 2009 Flexbox implementations support box-lines: multiple, which is required for enabling wrapping. Sadly, nearly all mobile devices support only the 2009 draft. Firefox versions that support the modern specification currently do not support wrapping either (flex-flow and flex-wrap are supported properties, but the values pertaining to wrapping are not supported).

    Third, you've got justify-content: space-around, but its 2009 counterpart is set to box-pack: center. Center is center in all drafts.

    http://cssdeck.com/labs/ccamtvl5

    .flex-container {
      display: -ms-flexbox;
      display: -webkit-flex;
      -webkit-flex-wrap: wrap;
      -ms-flex-wrap: wrap;
      flex-wrap: wrap;
      -ms-flex-line-pack: end;
      -webkit-align-content: flex-end;
      align-content: flex-end;
      -ms-flex-pack: distribute;
      -webkit-justify-content: space-around;
      justify-content: space-around;
      height: 100%;
    }
    @supports (flex-wrap: wrap) { /* hide from incomplete Firefox versions */
      .flex-container {
        display: flex;
      }
    }
    

    Update: Wrapping now works in Firefox as of version 28, but only when using the modern properties (not the old prefixed ones like display: -moz-box).

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