CSS column-span
Property
The column-span
property in CSS controls whether an element spans across multiple columns in a multi-column layout. It is commonly used for headings or elements that need to break column flow.
1. Syntax
Value | Description |
---|---|
none (default) | The element stays within a single column. |
all | The element spans across all columns. |
✅ Only works on block-level elements inside a multi-column container.
2. Example – Spanning a Heading Across All Columns
✅ The <h2>
spans across all columns, while the text continues in columns.
3. When to Use column-span
?
✔ Use for headings or images that should break the column flow.
✔ Works best inside a column-count
or column-width
layout.
✔ Does NOT work on flexbox or grid layouts.
4. Best Practices
✔ Use column-span: all;
sparingly for readability.
✔ Combine with column-gap
for better spacing.
✔ Ensure compatibility since some browsers may not support column-span
well.