CSS column-fill Property

Specify how to fill columns:

.newspaper1 {
-moz-column-fill: auto; /* Firefox */
column-fill: auto;
}

.newspaper2 {
-moz-column-fill: balance; /* Firefox */
column-fill: balance;
}

Try it Yourself »

More “Try it Yourself” examples below.


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. Read about animatable
Version: CSS3
JavaScript syntax: object.style.columnFill=”auto” Try it
CSS Syntax
column-fill: balance|auto|initial|inherit;
Property Values
Value Description
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. Read about initial
inherit Inherits this property from its parent element. Read about inherit

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

div {
-webkit-column-count: 3; /* Chrome, Safari, Opera */
-moz-column-count: 3; /* Firefox */
column-count: 3;
}

Try it Yourself »

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

div {
-webkit-column-rule: 4px double #ff00ff; /* Chrome, Safari, Opera */
-moz-column-rule: 4px double #ff00ff; /* Firefox */
column-rule: 4px double #ff00ff;
}

Try it Yourself »

Post Author: Zahid Farid