Thanks to visit codestin.com
Credit goes to www.cssportal.com

CSS Portal

CSS column-span Property

If this site has been useful, we’d love your support! Consider buying us a coffee to keep things going strong!

Description

The column-span property controls whether a block-level element inside a multi-column container breaks out of the column flow and is laid out across the full width of the container. In practice, when applied to an element it interrupts the columnized flow: the element is taken out of the column-balancing algorithm and rendered spanning the container instead of being confined to a single column track. This behavior typically produces a forced break before and after the spanning element so that the multi-column text resumes cleanly below it.

Because column-span changes how content participates in the multi-column formatting context, it interacts closely with the container’s column setup and break rules. It is meaningful only when there is an active multi-column environment created by properties such as column-count or column-width, and the visual result depends on spacing set by column-gap. Authors should also consider how it relates to fragmentation rules like break-inside, because spanning an element effectively forces fragmentation at that point in the flow and can influence where breaks occur in surrounding content.

Common use cases are headings, images, tables, or other elements that need to be shown full-width within an otherwise multi-column article - for example, a full-width title before a new section or a wide figure that should not be split across columns. When deciding to use this property, weigh its effect on readability and vertical rhythm: spanning elements can create larger vertical gaps and change column balance. If full-width layout control is needed across different screen sizes or more complex arrangements are required, authors often consider layout alternatives such as using display-based layout systems (Grid or Flexbox) to manage column-like behavior while retaining more predictable control over placement and wrapping.

Definition

Initial value
none
Applies to
Block-level elements, except floating and absolutely positioned elements
Inherited
No
Computed value
As specified
Animatable
No
JavaScript syntax
object.style.columnSpan

Interactive Demo

The rusty swing set creaked a lonely lullaby in the twilight, shadows lengthening like grasping fingers across the dew-kissed grass.
ColumnSpan
A lone dandelion seed, adrift on the breeze, whispered secrets of faraway fields, of dandelion suns and galaxies spun from fluff. Somewhere, beyond the veil of dusk, a coyote laughed, echoing through the stillness like a forgotten memory.

Syntax

column-span: none | all

Values

  • noneThe element does not span multiple columns.
  • allThe element spans across all columns. Content in the normal flow that appears before the element is automatically balanced across all columns before the element appears. The element establishes a new block formatting context.

Example

<div class='columns'>
<h2 class='span-all'>Featured: Spanning Heading</h2>
<p>Lorem ipsum dolor sit amet, consectetur adipiscing elit. Praesent vitae eros eu nunc volutpat volutpat. Integer non nisl at nibh facilisis tristique.</p>
<p>Curabitur ac sapien vitae mauris luctus facilisis. Integer dictum, lacus sed feugiat consequat, nisl sapien cursus mi, ac fermentum eros nibh vitae mi.</p>
<div class='banner span-all'>This banner spans all columns</div>
<p>Sed ut perspiciatis unde omnis iste natus error sit voluptatem accusantium doloremque laudantium.</p>
<p>Nemo enim ipsam voluptatem quia voluptas sit aspernatur aut odit aut fugit, sed quia consequuntur magni dolores eos qui ratione voluptatem sequi nesciunt.</p>
</div>
.columns {
    -webkit-column-count: 3;
    column-count: 3;
    -webkit-column-gap: 1.5rem;
    column-gap: 1.5rem;
    padding: 1rem;
    font-family: system-ui, -apple-system, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
}

.span-all {
    -webkit-column-span: all;
    column-span: all;
    display: block;
    background: #f4f6f8;
    padding: 0.75rem 1rem;
    margin: 0 0 1rem 0;
    border-radius: 6px;
}

.banner {
    text-align: center;
    font-weight: 600;
    color: #1a1a1a;
}

p {
    margin: 0 0 1rem 0;
    line-height: 1.6;
    text-align: justify;
    hyphens: auto;
}

/* Prevent column breaks inside paragraphs */
.columns p {
    break-inside: avoid-column;
}

Browser Support

The following information will show you the current browser support for the CSS column-span property. Hover over a browser icon to see the version that first introduced support for this CSS property.

This property is supported by all modern browsers.
Desktop
Chrome
Edge
Firefox
Opera
Safari
Tablets & Mobile
Chrome Android
Firefox Android
Opera Android
Safari iOS
Samsung Internet
Android WebView
-

Last updated by CSSPortal on: 1st January 2026

If this site has been useful, we’d love your support! Consider buying us a coffee to keep things going strong!