CSS column-fill Property

The column-fill property controls how content is distributed among columns in a CSS multi-column layout.

It determines whether the browser attempts to balance content across columns or fills each column sequentially before moving to the next. This is useful for articles, text-heavy sections, and layouts with a defined height.

The property works with column-count, column-width, and other multi-column properties. Its behavior depends on the available content, container height, and whether the layout is fragmented across pages or other containers.

column-fill Syntax

The column-fill property accepts keywords that specify how the browser should distribute content across columns.

selector {
  column-fill: balance;
}

General Syntax

selector {
  column-fill: auto | balance | balance-all;
}

Balanced Columns

.content {
  column-fill: balance;
}

Sequential Column Filling

.content {
  column-fill: auto;
}

Balance All Columns

.content {
  column-fill: balance-all;
}

The balance-all value is defined in the specification but has limited browser support. Do not rely on it without testing.

CSS-Wide Keywords

.content {
  column-fill: inherit;
}
.content {
  column-fill: initial;
}
.content {
  column-fill: unset;
}
.content {
  column-fill: revert;
}
.content {
  column-fill: revert-layer;
}

The column-fill property does not accept numeric values, percentages, or lengths.

Property Values

The property defines three column-filling behaviors.

Value Description
auto Fills columns sequentially, subject to available height and fragmentation constraints.
balance Attempts to distribute content evenly among columns. This is the initial value.
balance-all Requests balancing across all column fragments, including those before a fragmentation break. Browser support is limited.

CSS-Wide Keywords

Value Description
inherit Uses the computed value from the parent element.
initial Resets the property to balance.
unset Resets the property to balance because it is not inherited.
revert Reverts the property according to cascade origin rules.
revert-layer Reverts the property according to cascade layer rules.

Property Characteristics

Characteristic Value
Initial value balance
Inherited No
Applies to Multi-column containers
Computed value Specified keyword
Animation type Discrete
Percentages Not applicable
Primary use Controlling content distribution among columns

Column balancing is an attempt to distribute content evenly. Exact column heights can differ because of unbreakable elements, paragraph boundaries, and other fragmentation constraints.

How It Works

The column-fill property influences how the browser determines where content should break between columns.

Step 1: Create a Multi-column Container

.article-content {
  column-count: 3;
  column-gap: 24px;
}

Step 2: Select a Filling Method

.article-content {
  column-count: 3;
  column-gap: 24px;
  column-fill: balance;
}

Step 3: Calculate Available Space

The browser considers the content, available column height, column count, and any applicable fragmentation rules.

Step 4: Distribute Content

With balance, the browser attempts to distribute content evenly. With auto, it fills columns sequentially when a usable height constraint is available.

Step 5: Render the Columns

The browser displays the content according to the selected filling method, while preserving the document's logical reading order.

Important Distinction

The column-fill property does not specify the number or width of columns. Those are controlled by column-count and column-width.

balance Value

The balance value attempts to distribute content evenly among the columns.

.content {
  column-count: 3;
  column-fill: balance;
}

Default Behavior

balance is the initial value of column-fill.

Balanced Text Columns

.article {
  column-count: 3;
  column-gap: 30px;
  column-fill: balance;
}

The browser attempts to make the columns approximately equal in height, producing a more uniform layout.

Balancing Limitations

Column heights may differ when the content contains elements that cannot be split or when fragmentation rules prevent breaks at certain positions.

Paginated Content

When a multi-column container is fragmented across pages or similar contexts, balance generally balances the final fragment rather than requiring every earlier fragment to be balanced.

When to Use balance

Use balance when you want an even visual distribution of content in a typical multi-column text layout.

auto Value

The auto value fills columns sequentially rather than attempting to balance their heights.

.content {
  column-fill: auto;
}

Sequential Filling

The browser fills the first column until it reaches the available height, then continues into the next column.

Fixed-Height Example

.article {
  height: 240px;
  column-count: 3;
  column-gap: 24px;
  column-fill: auto;
}

Why Height Matters

Sequential filling requires a usable height limit. In an unconstrained-height container, browsers may have no definite column height at which to move to the next column.

Unconstrained Containers

Without a suitable height constraint, column-fill: auto may produce a single tall column instead of distributing content among the requested columns.

Overflow Behavior

If the content exceeds the available capacity of the specified columns, additional columns may be generated and extend beyond the container's inline size.

When to Use auto

Use auto when you want content to fill columns in sequence and the layout provides a meaningful height constraint.

balance-all Value

The balance-all value requests balancing across all column fragments, including fragments that occur before page or other fragmentation breaks.

.content {
  column-fill: balance-all;
}

Difference from balance

In fragmented layouts, balance generally balances only the final fragment. The balance-all value requests balancing in every fragment.

Paginated Layouts

The value is intended for situations where multi-column content spans multiple pages or fragmentation containers.

Browser Support

balance-all is not consistently supported across major browsers. Some browsers may ignore the declaration.

Fallback Declaration

.content {
  column-fill: balance;
  column-fill: balance-all;
}

Browsers that do not recognize balance-all retain the earlier balance declaration.

When to Use balance-all

Use this value only when its specialized fragmentation behavior is needed and has been tested in the browsers your project supports.

Container Height

The height of a multi-column container strongly influences how column-fill behaves.

Automatic Height

.content {
  column-count: 3;
  column-fill: balance;
}

With no fixed height, the browser can balance content across the requested columns.

Fixed Height

.content {
  height: 250px;
  column-count: 3;
  column-fill: auto;
}

A fixed height gives the browser a boundary for sequential filling.

Minimum Height

.content {
  min-height: 250px;
  column-count: 3;
  column-fill: balance;
}

A minimum height does not necessarily provide the same definite height constraint as height. The browser still determines the actual content height.

Maximum Height

.content {
  max-height: 300px;
  column-count: 3;
  column-fill: auto;
}

A maximum height can constrain the layout, but the resulting filling behavior depends on whether the height limit becomes effective.

Recommended Approach

Use balance for ordinary content sections with natural heights. Use auto when a defined column height is part of the layout design.

Column Count and Width

The column-fill property works with the properties that establish the multi-column layout.

column-count

.content {
  column-count: 3;
  column-fill: balance;
}

The browser attempts to distribute content across three columns.

column-width

.content {
  column-width: 220px;
  column-fill: balance;
}

The browser determines how many columns can fit while using the specified width as a target.

Both Properties

.content {
  column-count: 3;
  column-width: 220px;
  column-fill: balance;
}

The browser considers both the maximum requested column count and preferred column width.

columns Shorthand

.content {
  columns: 220px 3;
  column-fill: balance;
}

Column Spacing

.content {
  column-count: 3;
  column-gap: 30px;
  column-fill: balance;
}

The column-gap property controls spacing between columns but does not directly determine their filling method.

Content Overflow

Multi-column content can exceed the available space, especially when the container has a fixed height.

Fixed-Height Container

.content {
  height: 200px;
  column-count: 3;
  column-fill: auto;
}

Additional Columns

When content cannot fit into the specified number of columns, the browser may create additional columns beyond the container's available inline size.

Horizontal Overflow

In a left-to-right layout, extra columns may extend to the right and cause horizontal overflow.

Scrollable Container

.content {
  height: 200px;
  column-count: 3;
  column-fill: auto;
  overflow-x: auto;
}

Horizontal scrolling can make additional columns accessible, but it may not be a comfortable reading experience.

Prevent Unwanted Overflow

Consider using balanced columns, reducing the column count, increasing the available height, or allowing content to flow naturally.

Avoid Clipping Content

Be careful with overflow: hidden, which can make content inaccessible when additional columns extend beyond the container.

Fragmentation and Breaks

Multi-column layout uses CSS fragmentation rules to determine where content can break between columns.

Avoid Breaking an Element

.content .important-box {
  break-inside: avoid;
}

The browser attempts to keep the element together within a column when possible.

Force a Column Break

.content .new-section {
  break-before: column;
}

This requests that the element begin in a new column.

Break After an Element

.content .section-end {
  break-after: column;
}

Span All Columns

.content h2 {
  column-span: all;
}

A spanning element interrupts the column flow and can create separate column-balancing regions before and after it.

Balancing and Breaks

Forced breaks and elements that cannot be split can prevent columns from reaching equal heights.

Paginated Content

In paginated or otherwise fragmented layouts, balance and balance-all can differ in how they balance content across fragments.

Practical Recommendation

Use fragmentation controls sparingly and test the layout with both short and long content.

Practical Uses

The column-fill property is useful when the vertical distribution of multi-column content matters.

Balanced Article Text

.article {
  column-count: 3;
  column-gap: 30px;
  column-fill: balance;
}

Sequential Content Panels

.content-panel {
  height: 300px;
  column-count: 2;
  column-fill: auto;
}

Balanced Informational Sections

.information {
  column-width: 240px;
  column-gap: 24px;
  column-fill: balance;
}

Multi-column Lists

.link-list {
  column-count: 3;
  column-fill: balance;
}
.link-list li {
  break-inside: avoid;
}

Print-Oriented Layouts

@media print {
  .article {
    column-count: 2;
    column-fill: balance;
  }
}

Responsive Columns

.article {
  column-count: 3;
  column-fill: balance;
}
@media (max-width: 700px) {
  .article {
    column-count: 1;
  }
}

For most responsive text layouts, balanced columns with an appropriate column count provide a simpler and more predictable result than sequential filling in a fixed-height container.

column-fill Example

The following example compares balance and auto using two containers with the same height and content.

The balanced example attempts to distribute the text evenly. The sequential example fills the first column toward the available height before continuing into the second.

<div class="column-fill-demo">
  <div class="fill-example">
    <h3>column-fill: balance</h3>
    <div class="fill-content balanced">
      <p>HTML defines the structure of a web page.</p>
      <p>CSS controls colors, spacing, and layout.</p>
      <p>Selectors identify elements to style.</p>
      <p>Properties define presentation rules.</p>
    </div>
  </div>
  <div class="fill-example">
    <h3>column-fill: auto</h3>
    <div class="fill-content sequential">
      <p>HTML defines the structure of a web page.</p>
      <p>CSS controls colors, spacing, and layout.</p>
      <p>Selectors identify elements to style.</p>
      <p>Properties define presentation rules.</p>
    </div>
  </div>
</div>
.column-fill-demo {
  display: grid;
  gap: 25px;
}
.column-fill-demo .fill-example {
  padding: 15px;
  border: 1px solid #cccccc;
  background-color: #f8f9fa;
}
.column-fill-demo h3 {
  margin: 0 0 15px;
  font-size: 1.125rem;
}
.column-fill-demo .fill-content {
  height: 220px;
  column-count: 2;
  column-gap: 25px;
  column-rule: 1px solid #cccccc;
}
.column-fill-demo .balanced {
  column-fill: balance;
}
.column-fill-demo .sequential {
  column-fill: auto;
}
.column-fill-demo p {
  margin: 0 0 12px;
}
@media (max-width: 600px) {
  .column-fill-demo .fill-content {
    column-count: 1;
    height: auto;
    column-fill: balance;
  }
}
Browser Result

column-fill: balance

HTML defines the structure of a web page.

CSS controls colors, spacing, and layout.

Selectors identify elements to style.

Properties define presentation rules.

column-fill: auto

HTML defines the structure of a web page.

CSS controls colors, spacing, and layout.

Selectors identify elements to style.

Properties define presentation rules.

With balance, the browser attempts to distribute the content between both columns. With auto, the browser fills the first column sequentially and may leave the second column partially or completely empty.

The example uses a fixed height to demonstrate the difference. On smaller screens, the media query switches both layouts to a single column with automatic height.

The exact distribution can vary slightly depending on font metrics, available width, and browser fragmentation behavior.

Accessibility

Multi-column layouts should maintain a clear reading order and avoid making content difficult to navigate.

Preserve Logical Reading Order

CSS columns change the visual arrangement of content without changing the HTML document order. Assistive technologies generally follow the underlying document structure.

Avoid Excessive Column Heights

Very tall columns can require repeated vertical movement when reading from one column to the next.

Prevent Unnecessary Horizontal Scrolling

Fixed-height containers using column-fill: auto may create additional columns beyond the available width.

Use Responsive Layouts

Reduce the number of columns on narrow screens and at increased zoom levels.

Avoid Hidden Content

Do not combine overflowing multi-column layouts with clipping that makes important text inaccessible.

Keep Related Content Together

.article .important-note {
  break-inside: avoid;
}

Test Reflow

Check that text remains readable when users enlarge fonts or zoom the page. Balanced columns with natural height are often easier to adapt than fixed-height sequential layouts.

Important Considerations

Keep the following points in mind when using column-fill:

  • Purpose: Controls how content is distributed among columns.
  • Initial value: balance.
  • Inheritance: The property is not inherited.
  • Valid values: auto, balance, and balance-all.
  • balance: Attempts to distribute content evenly among columns.
  • auto: Fills columns sequentially when a usable height constraint is available.
  • balance-all: Requests balancing across all column fragments, but browser support is limited.
  • Container height: Strongly influences sequential filling behavior.
  • Automatic height: May prevent auto from producing multiple filled columns.
  • Fixed height: Provides a boundary for sequential column filling.
  • column-count: Specifies the desired number of columns.
  • column-width: Specifies a preferred column width.
  • column-gap: Controls spacing between columns.
  • Fragmentation: Break rules and unbreakable elements can affect distribution.
  • Spanning elements: Can divide content into separate column-balancing regions.
  • Overflow: Additional columns may extend beyond a fixed-height container.
  • Animation: Changes between values are discrete.
  • Responsive design: Adjust column counts and heights for smaller screens.
  • Accessibility: Maintain readable content flow and avoid clipping overflow.
  • Browser testing: Check complex fragmentation and balancing behavior across target browsers.

For most ordinary multi-column text layouts, the default balance value is appropriate. Use auto when sequential filling is required and the container has a suitable height constraint.

Browser Support

The column-fill property is widely supported in modern browsers, including Chrome, Edge, Firefox, and Safari, for the commonly used auto and balance values.

The balance-all value has limited support and should not be relied upon without testing.

Widely Supported Example

.content {
  column-count: 3;
  column-fill: balance;
}

Sequential Filling Example

.content {
  height: 250px;
  column-count: 3;
  column-fill: auto;
}

Fallback for balance-all

.content {
  column-fill: balance;
  column-fill: balance-all;
}

Compatibility Considerations

Column balancing, overflow, and fragmentation can vary in complex layouts. Test fixed-height containers, spanning elements, and forced column breaks in your target browsers.

For current compatibility information, visit Can I Use? and search for column-fill.

Specifications

The column-fill property is defined in the CSS Multi-column Layout specification.

CSS Multi-column Layout Module Level 1

The specification defines the auto, balance, and balance-all values and describes how content is distributed in multi-column formatting contexts.