CSS column-fill Property

Example

Specify how to fill columns:

.newspaper1 {
  column-fill: auto;
}

.newspaper2 {
  column-fill: balance;
}

Definition and Usage

The column-fill property specifies how to fill columns, balanced or not.

Tip: If you add a height to a multi-column element, you can control how the content fills the columns. The content can be balanced or filled sequentially.

Default value: balance
Inherited: no
Animatable: no.
Version: CSS3
JavaScript syntax: object.style.columnFill="auto"

  • Inherited : "Inherited = no" means that it cannot takes (inherit) it's value from it's parent element.
  • object - object in javascript means the element on which column-fill is applied.
  • Animatable - "Animatable = no" means that it cannot be animated with CSS @keyframes.

Browser Support

The numbers in the table specify the first browser version that fully supports the property.

Numbers followed by -moz- specify the first version that worked with a prefix.

Property          
column-fill 50.0 10.0 52.0
13.0 -moz-
10.0
7.0 -webkit-
37.0

CSS Syntax

column-fill: balance|auto|initial|inherit;

Property Values

Value Description Demo
balance Default value. Fills each column with about the same amount of content, but will not allow the columns to be taller than the height (so, columns might be shorter than the height as the browser distributes the content evenly horizontally)
auto Fills each column until it reaches the height, and do this until it runs out of content (so, this value will not necessarily fill all the columns nor fill them evenly)
initial Sets this property to its default value.  
inherit Inherits this property from its parent element.  

More Examples

Example

Divide the text in a <div> element into three columns:

div {
  column-count: 3;
}

Example

Specify a 40 pixels gap between the columns:

div {
  column-gap: 40px;
}

Example

Specify the width, style, and color of the rule between columns:

div {
  column-rule: 4px double #ff00ff;
}

Comments