column-count

Avatar of Katy DeCorah
Katy DeCorah on (Updated on )

DigitalOcean provides cloud products for every stage of your journey. Get started with $200 in free credit!

If you need an exact numbers of columns when designing a multi-column layout, use column-count.

.lead {
  column-count: 3;
 }

Given the number of columns, the browser will evenly distribute the content in exactly that number of columns.

This property can also be used in the shorthand for columns and can be used in tandem with column-width. When both properties are declared column-count is the maximum number of columns.

Values

column-count can be auto or an integer.

Use auto if you are also using column-width. Think of it as a way of telling the browser, to let column-width take the lead.

The integer, also known as the number of columns, must be greater than or equal to 0.

Unlike column-width this property will hold the number of columns regardless of the browser width. This means that if you pulled up a 5-columned layout on your mobile phone, you will have a very squished 5-columned layout to navigate. column-count works best alongside column-width.

Additional Resources

Browser Support

Multi-column layout support:

ChromeSafariFirefoxOperaIEAndroidiOS
Any3+1.5+11.1+10+813.2+

Don’t forget your prefixes if you aren’t using a tool that helps with that already.