What is CSS column-count property?

In CSSCascade Style Sheets, the column-count property specifies the number of columns when defining a multi-column layout.

Syntax


column-count: number|auto|initial|inherit;

Property values

  • number: It specifies the number of columns in which we want to divide our data.

  • auto: This is the default value. It determines the number of columns by using other properties like column-width.

  • initial: This sets the value to its default value.

  • inherit: This is used to inherit property from its parent value.

Code

The following is the basic HTMLHyperText Markup Language and CSS code to demonstrate the use of the column-count property:

Explanation

Here in this example, we have divided the paragraph into two columns. We can also split the section into multiple columns depending upon the need.

New on Educative
Learn to Code
Learn any Language as a beginner
Develop a human edge in an AI powered world and learn to code with AI from our beginner friendly catalog
🏆 Leaderboard
Daily Coding Challenge
Solve a new coding challenge every day and climb the leaderboard

Free Resources