Spec-Zone.ru › CSS

`column-fill` CSS property

Baseline Widely available

This feature is well established and works across many devices and browser versions. It's been available across browsers since March 2017.

The column-fill CSS property controls how an element's contents are balanced when broken into columns.

Try it

column-fill: auto;
column-fill: balance;
<section id="default-example">
  <p id="example-element">
    London. Michaelmas term lately over, and the Lord Chancellor sitting in
    Lincoln's Inn Hall. Implacable November weather.
  </p>
</section>
#example-element {
  width: 100%;
  height: 90%;
  columns: 3;
  text-align: left;
}

Syntax

/* Keyword values */
column-fill: auto;
column-fill: balance;

/* Global values */
column-fill: inherit;
column-fill: initial;
column-fill: revert;
column-fill: revert-layer;
column-fill: unset;

Values

This property is specified as one of the following keyword values:

auto
Columns are filled sequentially. Content takes up only the room it needs, possibly resulting in some columns remaining empty.
balance
Content is equally divided between columns. In fragmented contexts, such as paged media, only the last fragment is balanced. Therefore in paged media, only the last page would be balanced. This is the default value.

The specification defines a balance-all value, in which content is equally divided between columns in fragmented contexts, such as paged media. This value is not yet supported in any browser.

Formal definition

Initial value balance
Applies to multicol elements
Inherited no
Computed value as specified
Animation type discrete

Formal syntax

column-fill = 
  auto |
  balance

Examples

Balancing column content

HTML

<p class="fill-auto">
  This paragraph fills columns one at a time. Since all of the text can fit in
  the first column, the others are empty.
</p>

<p class="fill-balance">
  This paragraph attempts to balance the amount of content in each column.
</p>

CSS

p {
  height: 7em;
  background: #ffff99;
  columns: 3;
  column-rule: 1px solid;
}

p.fill-auto {
  column-fill: auto;
}

p.fill-balance {
  column-fill: balance;
}

Result

Specifications

Specification
CSS Multi-column Layout Module Level 1
# cf

Browser compatibility

Desktop Mobile
Chrome Edge Firefox Opera Safari Chrome Android Firefox for Android Opera Android Safari on iOS Samsung Internet WebView Android WebView on iOS
column-fill
50
12
52
17–74
37
9
8
50
52
17–79
37
9
8
5.0
50
9
8
auto
50
12
17
37
8
50
17
37
8
5.0
50
8
balance
50
12
17
37
8
50
17
37
8
5.0
50
8

Warning: There are some interoperability issues and bugs with column-fill across browsers, due to unresolved issues in the specification.

In particular, when using column-fill: auto to fill columns sequentially, Chrome will only consult this property if the multicol container has a size in the block dimension (e.g., height in a horizontal writing mode). Firefox will always consult this property, therefore filling the first column with all of the content in cases where there is no size.

See also

  • Learn: Multiple-column Layout
  • column-count
  • column-width

© 2005–2025 MDN contributors.
Licensed under the Creative Commons Attribution-ShareAlike License v2.5 or later.
https://developer.mozilla.org/en-US/docs/Web/CSS/Reference/Properties/column-fill

Spec-Zone.ru

Настройки Оффлайн Что нового Помощь О нас
Spec-Zone .ru
спецификации, руководства, описания, API