Knowledge baseExam Center
ENEnglish
Choose language13

CKTIS / CSS

column-span — spanning an element across columns

The column-span property lets a block-level element span columns in a multi-column layout. The all value creates a band across every column, whereas none preserves ordinary flow. Level 2 proposals require separate implementation verification.

Version: CSS modules; structured CSSWG indexes reconciled with pinned MDN BCD; Chromium 152 scope gate, per-example verification still required

Syntax

column-span: none | all;
/* Level 2 draft additions; verify implementation separately: */
column-span: <integer [1,∞]> | auto;

column-span applies to in-flow block-level elements. Its initial value, none, does not create a spanning element. The property is not inherited, and its animation type is discrete. It is not the equivalent of an item's span in CSS Grid.

all forces a column break and spans every column in the current multi-column row. Preceding content is balanced into columns above it; subsequent content enters new columns below it. The element establishes an independent formatting context, even outside a multi-column container.

A nested element can span columns if it remains in the same block formatting context. An intervening ancestor establishing a containing block for descendants with position: fixed, for example through transform, prevents that spanning. When space is insufficient, the browser may treat spanning as none.

The Level 2 draft adds a positive integer and auto: the integer specifies the number of columns spanned, while auto chooses based on the outer min-content size in the inline axis. A number at least equal to the column count behaves like all; details of integer values remain underspecified. Do not assume these proposals work in Chromium 152 without separate testing. The example uses only all.

Examples

<!doctype html>
<meta charset="utf-8">
<title>column-span</title>
<style>
  .columns { width: 320px; column-count: 2; column-gap: 20px; }
  .block { height: 40px; break-inside: avoid; background: #ddd; }
  h2 { column-span: all; margin: 0; font: 20px/40px sans-serif; background: #bde; }
</style>
<div class="columns">
  <div class="block">A</div>
  <div class="block">B</div>
  <h2>Heading</h2>
  <div class="block">C</div>
  <div class="block">D</div>
</div>

Result

Expected layout: A and B occupy two 150px-wide columns above Heading. Heading spans the full 320px content width. C and D occupy two columns below it.

The displayed code and declared result were verified in an isolated environment using the method recorded in the verification evidence for this exact version.

Sources