非标
此特征是非标准的,且不在标准轨道中。不要在面向 Web 的生产站点中使用它:它不适用于每个用户。实现之间可能存在大的不兼容性,且行为将来可能改变。

This is a property of the original CSS Flexible Box Layout Module draft, and has been replaced by a newer standard. See flexbox for information about the current standard.

box-flex-group CSS property assigns the flexbox's child elements to a flex group.

/* <integer> values */
box-flex-group: 1;
box-flex-group: 5;
/* Global values */
box-flex-group: inherit;
box-flex-group: initial;
box-flex-group: unset;
					

For flexible elements assigned to flex groups, the first flex group is 1 and higher values specify subsequent flex groups. The initial value is 1. When dividing up the box's extra space, the browser first considers all elements within the first flex group. Each element within that group is given extra space based on the ratio of that element's flexibility compared to the flexibility of other elements within the same flex group. If the space of all flexible children within the group has been increased to the maximum, the process repeats for the children within the next flex group, using any space left over from the previous flex group. Once there are no more flex groups, and there is still space remaining, the extra space is divided within the containing box according to the box-pack 特性。

If the box would overflow after the preferred space of the children has been computed, then space is removed from flexible elements in a manner similar to that used when adding extra space. Each flex group is examined in turn and space is removed according to the ratio of the flexibility of each element. Elements do not shrink below their minimum widths.

句法

box-flex-group property is specified as any positive <integer> .

形式定义

初始值 1
适用于 in-flow children of box elements
继承 no
计算值 如指定
动画类型 discrete

形式句法

<integer>
					

范例

Simple usage example

In the original Flexbox spec, box-flex-group could be used to assign flex children to different groups to distribute flexible space between:

article:nth-child(1) {
  -webkit-box-flex-group: 1;
}
article:nth-child(2) {
  -webkit-box-flex-group: 2;
}
					

This was only ever supported in WebKit-based browsers, with a prefix, and in subsequent versions of the spec this functionality does not have an equivalent. Instead, distribution of space inside the flex container is now handled using flex-basis , flex-grow ,和 flex-shrink .

规范

Not part of any standard.

浏览器兼容性

The compatibility table on this page is generated from structured data. If you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request. 更新 GitHub 上的兼容性数据
Desktop Mobile
Chrome Edge Firefox Internet Explorer Opera Safari Android webview Chrome for Android Firefox for Android Opera for Android Safari on iOS Samsung Internet
box-flex-group 弃用 非标 Chrome 不支持 1 — 67 Prefixed
不支持 1 — 67 Prefixed
Prefixed Implemented with the vendor prefix: -webkit-
Edge 不支持 No Firefox 不支持 No IE 不支持 No Opera 不支持 15 — 54 Prefixed
不支持 15 — 54 Prefixed
Prefixed Implemented with the vendor prefix: -webkit-
Safari 完整支持 3 Prefixed
完整支持 Prefixed
Prefixed Implemented with the vendor prefix: -webkit-
不支持 1.1 — 3 Prefixed
Prefixed Implemented with the vendor prefix: -khtml-
WebView Android 不支持 ≤37 — 67 Prefixed
不支持 ≤37 — 67 Prefixed
Prefixed Implemented with the vendor prefix: -webkit-
Chrome Android 不支持 18 — 67 Prefixed
不支持 18 — 67 Prefixed
Prefixed Implemented with the vendor prefix: -webkit-
Firefox Android 不支持 No Opera Android 不支持 14 — 48 Prefixed
不支持 14 — 48 Prefixed
Prefixed Implemented with the vendor prefix: -webkit-
Safari iOS 完整支持 1 Prefixed
完整支持 Prefixed
Prefixed Implemented with the vendor prefix: -webkit-
Samsung Internet Android 不支持 1.0 — 9.0 Prefixed
不支持 1.0 — 9.0 Prefixed
Prefixed Implemented with the vendor prefix: -webkit-

图例

完整支持

完整支持

不支持

不支持

非标。预期跨浏览器支持较差。

非标。预期跨浏览器支持较差。

弃用。不要用于新网站。

弃用。不要用于新网站。

要求使用供应商前缀或不同名称。

要求使用供应商前缀或不同名称。

另请参阅

元数据

  • 最后修改: