CSS column-fill Property


Example

Specify how to fill columns:

.newspaper1 {
  column-fill: auto;
}

.newspaper2 {
  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.

Show demo ❯

Default value: balance
Inherited: no
Animatable: no. Read about animatable
Version: CSS3
JavaScript syntax: object.style.columnFill="auto" Try it

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) Demo ❯
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) Demo ❯
initial Sets this property to its default value. Read about initial
inherit Inherits this property from its parent element. Read about inherit

More Examples

Example

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

div {
  column-count: 3;
}
Try it Yourself »

Example

Specify a 40 pixels gap between the columns:

div {
  column-gap: 40px;
}
Try it Yourself »

Example

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

div {
  column-rule: 4px double #ff00ff;
}
Try it Yourself »

Related Pages

CSS tutorial: CSS Multiple Columns

HTML DOM reference: columnFill property


Copyright 1999-2023 by Refsnes Data. All Rights Reserved.