What is the CSS column-gap property?

The column-gap property in CSSCascade Style Sheets defines the gap we want between the columns by adding a space between them.

Syntax


column-gap: length|normal|initial|inherit;

Property values

  • length: It specifies the length of the gap we want between the columns.

  • normal: It is the default value, and specifies that there is a normal gap between the columns.

  • 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-gap property:

Explanation

In this example, we have made a grid and set the column-gap as 50px. We can also set the gap 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