What is the CSS column-width property?

The column-width property in CSSCascade Style Sheets is used to define the width of the column when we are using a multi-column layout.


We can also use the column property to set the column count and width only once.


Syntax


column-width: auto|length|initial|inherit;

Property values

  • auto: It is the default value. The width of the column is specified by the browser automatically.

  • length: It is used to define the width of the column.

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

  • inherit: This inherits property from its parent value.

Code

The following is the basic HTMLHyperText Markup Language & CSS code to demonstrate the use of the column-width property.

Explanation

In this example, we can see that we have set the width between the columns as 200px.

We can also set the width according to our choice.

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