Do I not understand the flex-grow property?

后端 未结 3 636
孤街浪徒
孤街浪徒 2020-12-02 17:53

I\'m afraid I must not understand flex-grow. If you jump to the JSFiddle below - the way I understand it, .big should be three times the size of the other

3条回答
  •  情书的邮戳
    2020-12-02 18:35

    Authors are encouraged to control flexibility using the flex shorthand rather than with flex-grow directly, as the shorthand correctly resets any unspecified components to accommodate common uses.

    https://drafts.csswg.org/css-flexbox/#propdef-flex-grow

    .flex-item {
       flex: 1;
    }
    .big {
       flex: 3;
    }
    

    This is a working example

    http://codepen.io/anon/pen/VjZYPV

提交回复
热议问题