A balanced set of columns is where all columns have approximately the same amount of content. Filling and balancing comes into play when the amount of content does not match the amount of space provided, such as when a height is declared on the container.
The initial value of multicol for column-fill
is balance
. The value of balance means all columns are as balanced as is possible. In fragmented contexts such as Paged Media, only the last fragment is balanced. This means that on the last page the final set of column boxes will be balanced.
There is a second value for balancing, balance-all
, which attempts to balance all columns in fragmented contexts and not just the columns on the final fragment.
In this example, we have columns containing an image and some text which are balanced. The image cannot break and so goes into the first column and the other columns fill with equal amounts of text.
The other value for column-fill
is auto
. In this case, rather than filling all the columns equally so their heights are balanced, the columns are filled sequentially. In the example below we have changed column-fill
to auto
and the columns are now filled, in order, to the height of the multicol container, leaving some columns empty at the end.
Note that column balancing is not supported by all browsers. Check that you are getting the sort of effect that you expect in the browsers you support.