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.

Free Resources