CSS

CSS

🎯 CSS column-span Property

The column-span CSS property defines whether an element in a multi-column layout spans across one column or all columns.

It is commonly used to make headings, images, or important sections stretch across the full width of a multi-column layout.

🔹 Why Use column-span?

  • Benefits

  • Creates strong visual emphasis for headings.
  • Breaks multi-column layouts for important content.
  • Improves readability and layout hierarchy.
  • Commonly used in magazine and newspaper layouts.

🧩 Basic Usage

The following example makes a heading span across all columns.

CSS

h2 {
    column-span: all;
}
                

🔹 column-span Values

1️⃣ none

Default value. The element stays within a single column and does not span across others.

CSS

div {
    column-span: none;
}
                

2️⃣ all

The element spans across all columns, breaking the multi-column flow.

CSS

h2 {
    column-span: all;
}
                

3️⃣ initial

Resets the property to its default value (none).

CSS

div {
    column-span: initial;
}
                

4️⃣ inherit

Inherits the column-span value from its parent element.

CSS

div {
    column-span: inherit;
}
                
  • 🧠 Summary

  • column-span controls whether an element spans one or all columns.
  • all is used for full-width headings or emphasized content.
  • none keeps the element inside a single column.
  • Frequently used in multi-column magazine and article layouts.