大网数据广告活动
Web 标准与前端开发

`<content-distribution>` CSS type

· 52CE 我爱测

The **`<content-distribution>`** enumerated value type is used by justify-content and align-content properties, and the place-content shorthand, to distribute a container's extra space among its alignment subject.

The <content-distribution> enumerated value type is used by justify-content and align-content properties, and the place-content shorthand, to distribute a container's extra space among its alignment subject.

Syntax

<content-distribution> = space-between | space-around | space-evenly | stretch

Values

The following keyword values are represented by the <content-distribution> grammar term:

  • space-between

    • : Evenly distributes the alignment subject within the alignment container. The first item is placed flush with the start edge of the alignment container, the last item subject is placed flush with the end edge of the alignment container, and the remaining items are evenly distributed so that the spacing between any two adjacent items is the same. The default fallback alignment for space-between is safe flex-start for flex layout, and start otherwise. If there is only one item, the item will be flush with the start edge.
  • space-around

    • : The items are evenly distributed in the container, with a half-size space on either end. The spacing between any two adjacent items is the same, and the spacing before the first and after the last items is half the size of the other spacing. The default fallback alignment for space-around is safe center. If the container has only one child, the item will be centered.
  • space-evenly

    • : The items are evenly distributed in the container, with a full-size space on either end. The spacing between any two adjacent items, before the first item, and after the last item, are all the same. The default fallback alignment for space-evenly is safe center. If the container has only one child, the item will be centered.
  • stretch

    • : If the combined size of the items is less than the size of the container, any items that can grow will have their size increased equally (not proportionally), while still respecting the constraints imposed by max-height, max-width, or equivalent functionality, so that the combined size of the items exactly fills the container. The default fallback alignment for stretch is flex-start in flexbox, and start in other layout modes. If there is only one item, and that item can grow, it will grow to fill the container.

Specifications

See also

来源:MDN Web Docs / Mozilla 贡献者 · 作者与贡献记录 · CC BY-SA 2.5。离线整理了版式、链接和媒体显示。

资料来源与适用范围

资料来源
MDN Web Docs / Mozilla 贡献者
适用范围
请按文中版本与环境说明核对
内容语言
中文;命令、路径和错误标识保留技术原文
本地收录日期
2026-11-15
授权说明
CC BY-SA 2.5

正文与所需资源由本站本地存储。查看来源及更新记录 ↗

请按适用版本和实际日志确认原因;本站没有对每一种系统或设备逐项执行文中的操作。