Knowledge baseExam Center
ENEnglish
Choose language13

CKTIS / CSS

column-height — column block size

column-height specifies the desired block-axis size of columns in a multi-column layout. Together with column-wrap, it enables additional rows of columns.

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

Syntax

column-height: auto | <length [0,∞]>;

column-height sets the column’s block-axis size, not the entire container’s height. Its initial auto depends on content and other properties. Nonnegative lengths are accepted; percentages are invalid. The property is not inherited.

With column-wrap: wrap, excess content creates another column row; nowrap sends additional columns along the inline axis. The specified size remains even for a partially filled row.

The example shows A B above C D. This is a CSS Multi-column Layout Level 2 draft feature; check support in your target browser.

Examples

<!doctype html>
<meta charset="utf-8">
<title>column-height</title>
<style>
  .columns {
    width: 220px;
    column-count: 2;
    column-gap: 20px;
    column-height: 40px;
    column-wrap: wrap;
    column-fill: auto;
    row-gap: 10px;
  }
  .item {
    height: 40px;
    break-inside: avoid;
    background: #ddd;
  }
</style>
<div class="columns">
  <div class="item">A</div>
  <div class="item">B</div>
  <div class="item">C</div>
  <div class="item">D</div>
</div>

Result

A B
C D

The example code and two-row layout were verified in an isolated browser environment.

Sources