The column-span property

The column-span property specifies a number of columns that an element in multi-column text should span. The property value is either the number 1 or the all keyword. With a value of 1 the element will span one column, and with a value of all - all columns.

Syntax

cssselector {
  column-span: 1 | all;
}

Default value: 1.

Example

In this example, the title will fall inside the first column:

html<div id="elem">
  <h2>Lorem ipsum dolor sit amet eu metus non</h2>
  some long text
</div>
css#elem h2 {
  column-span: 1;
  margin: 0;
}
#elem {
  column-count: 3;
  text-align: justify;
}

Результат:

Example

And now the title will stretch across all columns:

html<div id="elem">
  <h2>Lorem ipsum dolor sit amet eu metus non</h2>
  some long text
</div>
css#elem h2 {
  column-span: all;
  margin: 0;
}
#elem {
  column-count: 3;
  text-align: justify;
}

Результат:

See also

  • the column-count property
    that specifies a number of columns
  • the column-width property
    that specifies a column width
  • the column-gap property
    that specifies a gap between columns
  • the column-rule property
    that specifies a border between columns
  • the columns property
    that is a shorthand property for multi-column