CSS column-height Property
The column-height property specifies the desired height of columns in a CSS multi-column layout.
It is part of CSS Multi-column Layout Level 2 and is intended to make long multi-column content easier to read by controlling column height independently of the container's overall height.
When combined with column-wrap, the property can allow additional columns to continue on a new row rather than extending horizontally beyond the container. This is an experimental feature with limited browser support.
column-height Syntax
The column-height property accepts the keyword auto or a non-negative CSS length.
selector {
column-height: 300px;
}
General Syntax
selector {
column-height: auto | <length [0,∞]>;
}
Automatic Height
.content {
column-height: auto;
}
Pixel Height
.content {
column-height: 300px;
}
Font-Relative Height
.content {
column-height: 20em;
}
Viewport-Relative Height
.content {
column-height: 80vh;
}
CSS-Wide Keywords
.content {
column-height: inherit;
}
.content {
column-height: initial;
}
.content {
column-height: unset;
}
.content {
column-height: revert;
}
.content {
column-height: revert-layer;
}
Negative lengths and percentages are not valid values. Although zero is syntactically permitted, it is generally not useful for displaying readable content.
Property Values
The property defines two types of values: automatic sizing and an explicit column height.
| Value | Description |
|---|---|
auto |
Determines column height from the content and other layout constraints. This is the initial value. |
300px |
Requests columns with a height of 300 pixels. |
20em |
Requests a column height relative to the element's font size. |
25rem |
Requests a column height relative to the root font size. |
80vh |
Requests a column height relative to the viewport height. |
clamp(200px, 60vh, 500px) |
Uses a calculated length constrained by minimum and maximum values. |
CSS-Wide Keywords
| Value | Description |
|---|---|
inherit |
Uses the computed value from the parent element. |
initial |
Resets the property to auto. |
unset |
Resets the property to auto because it is not inherited. |
revert |
Reverts the property according to cascade origin rules. |
revert-layer |
Reverts the property according to cascade layer rules. |
Property Characteristics
| Characteristic | Value |
|---|---|
| Initial value | auto |
| Inherited | No |
| Applies to | Block containers except table wrapper boxes |
| Computed value | auto or an absolute length |
| Animation type | By computed value type |
| Percentages | Not applicable |
| Specification | CSS Multi-column Layout Module Level 2 |
| Availability | Experimental, limited browser support |
The property describes the desired height of individual columns, not necessarily the total height of the multi-column container.
How It Works
The proposed column-height behavior allows a multi-column container to establish columns with a desired block size.
Step 1: Establish Multiple Columns
.article {
column-count: 3;
column-gap: 24px;
}
Step 2: Set the Column Height
.article {
column-count: 3;
column-gap: 24px;
column-height: 250px;
}
Step 3: Determine the Column Layout
The browser calculates column widths and uses the requested height when laying out the content.
Step 4: Fill the Columns
Content flows through the columns according to the multi-column layout and fragmentation rules.
Step 5: Continue Excess Content
With column wrapping enabled, content that does not fit in the current row of columns continues into another row.
Result
Supporting browsers can create multiple rows of columns with a consistent desired height, reducing the need to read down an extremely tall column before returning to the top of the next one.
auto Value
The auto value allows the browser to determine column height from the available content and other layout properties.
.article {
column-count: 3;
column-height: auto;
}
Initial Behavior
auto is the initial value and preserves the familiar behavior of multi-column layout.
Unconstrained Container
When the container does not have a fixed height, the browser can balance the content across its columns.
Constrained Container
.article {
height: 300px;
column-count: 3;
column-height: auto;
}
With a constrained container height, the columns are subject to that height. Excess content may continue into additional columns that overflow in the inline direction.
Automatic Wrapping Behavior
When column-wrap is also auto, an automatic column height resolves to non-wrapping behavior.
When to Use auto
Use auto when the existing multi-column layout behavior is sufficient and a specific column height is unnecessary.
Length Values
A length value requests a specific height for the columns.
Fixed Pixel Height
.article {
column-count: 3;
column-height: 300px;
}
Font-Relative Height
.article {
column-count: 3;
column-height: 22em;
}
Using em allows the desired column height to scale with the element's font size.
Root-Relative Height
.article {
column-count: 3;
column-height: 25rem;
}
Viewport Height
.article {
column-count: 3;
column-height: 80vh;
}
Viewport-relative heights can help keep columns shorter than the visible screen area, although the surrounding interface and browser controls must also be considered.
Calculated Height
.article {
column-height: clamp(240px, 70vh, 600px);
}
Invalid Values
.article {
column-height: -100px;
}
.article {
column-height: 50%;
}
Negative lengths and percentages are invalid for column-height.
Important Limitation
A specified length describes the desired column height. Content that cannot be fragmented may overflow rather than fitting entirely within that height.
column-wrap Interaction
The experimental column-wrap property controls whether additional columns continue horizontally or wrap into a new row.
Automatic Wrapping
.article {
column-count: 3;
column-height: 250px;
column-wrap: auto;
}
When column-height specifies a length, column-wrap: auto resolves to wrapping behavior.
Explicit Wrapping
.article {
column-count: 3;
column-height: 250px;
column-wrap: wrap;
}
Additional columns can continue on another row when the current row has no remaining space.
Prevent Wrapping
.article {
column-count: 3;
column-height: 250px;
column-wrap: nowrap;
}
The nowrap value keeps additional columns progressing in the inline direction, potentially producing horizontal overflow.
Relationship Between the Properties
| column-height | column-wrap: auto Behavior |
|---|---|
auto |
Resolves to nowrap. |
250px |
Resolves to wrap. |
Both properties are newer multi-column features and should be tested together before use in production.
Column Count and Width
The column-height property works with column-count and column-width to control the dimensions of a multi-column layout.
Column Count
.article {
column-count: 3;
column-height: 250px;
}
The count specifies the desired number of columns in each row, while the height specifies their desired block size.
Column Width
.article {
column-width: 220px;
column-height: 250px;
}
The browser determines how many columns of approximately the requested width can fit.
Combined Dimensions
.article {
column-count: 3;
column-width: 220px;
column-height: 250px;
}
Available Space
Column widths and counts remain subject to available inline space. The requested height influences the block-size arrangement.
Additional Rows
When wrapping is enabled, content that exceeds the available columns can continue into another row of columns.
Choosing Dimensions
Use column-width to target comfortable line lengths and column-height to limit the distance readers must travel vertically through a column.
columns Shorthand
CSS Multi-column Layout Level 2 extends the columns shorthand to include column-height.
Column Width and Count
.article {
columns: 220px 3;
}
Column Height in the Shorthand
.article {
columns: 220px 3 / 250px;
}
The forward slash separates the optional column height from the column width and count.
Column Count and Height
.article {
columns: 3 / 300px;
}
Column Width and Height
.article {
columns: 220px / 300px;
}
Equivalent Longhand Properties
.article {
column-width: 220px;
column-count: 3;
column-height: 250px;
}
Compatibility Warning
The extended shorthand syntax is experimental. Browsers that do not recognize it may ignore the entire declaration.
Safer Fallback
.article {
columns: 220px 3;
column-height: 250px;
}
This keeps the widely supported width and count declaration separate from the experimental height declaration.
Container Height
The height and column-height properties control different aspects of the layout.
Container Height
.article {
height: 300px;
column-count: 3;
}
The height property constrains the element's content box rather than directly requesting the height of each column.
Column Height
.article {
column-count: 3;
column-height: 300px;
}
The column-height property requests the height of individual columns.
Both Properties
.article {
height: 500px;
column-count: 3;
column-height: 250px;
}
When both properties are specified, additional space may remain inside the container. The applicable alignment rules determine how that space is handled.
Content Overflow
Constraining a container's height can cause extra columns to overflow horizontally in traditional multi-column layouts.
Wrapped Column Rows
The newer column-height and column-wrap features are intended to allow content to continue in additional rows instead.
Production Recommendation
Do not treat height and column-height as interchangeable. They describe different layout constraints.
Column Filling
The column-fill property influences how content is distributed within the available columns.
Balanced Columns
.article {
column-count: 3;
column-height: 250px;
column-fill: balance;
}
The browser attempts to balance content while respecting the applicable column height and fragmentation constraints.
Sequential Filling
.article {
column-count: 3;
column-height: 250px;
column-fill: auto;
}
Sequential filling places content into columns according to the available height before continuing into another column.
Unbreakable Content
Large images, tables, and other content that cannot be split may overflow the requested column height.
Fragmentation Rules
.article .important-note {
break-inside: avoid;
}
Fragmentation controls can influence where content breaks, but they cannot guarantee that oversized content will fit within a column.
When to Adjust Filling
Use column-fill when you need to influence content distribution. Use column-height when you need to specify the desired vertical size of columns.
Row and Column Spacing
Wrapped multi-column layouts can contain both horizontal gaps between columns and vertical gaps between rows of columns.
Column Spacing
.article {
column-count: 3;
column-height: 250px;
column-gap: 24px;
}
Row Spacing
.article {
column-count: 3;
column-height: 250px;
row-gap: 30px;
}
In the newer multi-column model, row-gap specifies spacing between rows of columns.
gap Shorthand
.article {
column-count: 3;
column-height: 250px;
gap: 30px 24px;
}
The first value specifies the row gap, and the second specifies the column gap.
Column Rules
.article {
column-count: 3;
column-height: 250px;
column-gap: 24px;
column-rule: 1px solid #cccccc;
}
Column rules provide visual separators between adjacent content columns.
Compatibility Considerations
Spacing between wrapped rows of multi-column content depends on support for the newer multi-column layout features.
Practical Uses
The proposed column-height property is intended for layouts where controlling the vertical length of individual columns improves usability.
Long Articles
.article {
column-width: 240px;
column-height: 70vh;
column-gap: 30px;
}
Multi-column Lists
.reference-list {
column-width: 200px;
column-height: 300px;
column-wrap: wrap;
}
Documentation Pages
.documentation {
column-count: 2;
column-height: 400px;
column-gap: 25px;
}
Viewport-Relative Reading Layouts
.reading-content {
column-width: 260px;
column-height: 85vh;
column-wrap: wrap;
}
Responsive Column Heights
.article {
column-width: 240px;
column-height: 400px;
}
@media (max-width: 700px) {
.article {
column-width: auto;
column-count: 1;
column-height: auto;
}
}
Experimental Use
These examples illustrate the intended feature. In browsers without support, the column-height declaration is ignored and the remaining supported multi-column properties continue to apply.
column-height Example
The following example demonstrates a proposed wrapped multi-column layout using a specified column height.
In supporting browsers, the columns have a desired height of 160 pixels, and additional content can continue into another row. In unsupported browsers, the content uses the fallback multi-column layout.
<div class="column-height-demo">
<h3>Experimental Column Height</h3>
<div class="column-content">
<p>HTML provides the structure of a web page.</p>
<p>CSS controls the visual presentation of content.</p>
<p>Selectors identify the elements to style.</p>
<p>Properties define how elements are displayed.</p>
<p>Grid and Flexbox organize interface layouts.</p>
<p>Multi-column layout divides flowing content.</p>
<p>Media queries adapt designs to screen sizes.</p>
<p>Responsive layouts improve readability.</p>
</div>
</div>
.column-height-demo {
padding: 15px;
border: 1px solid #cccccc;
background-color: #f8f9fa;
}
.column-height-demo h3 {
margin: 0 0 15px;
font-size: 1.125rem;
}
.column-height-demo .column-content {
column-count: 2;
column-gap: 24px;
column-rule: 1px solid #cccccc;
column-height: 160px;
column-wrap: wrap;
row-gap: 20px;
}
.column-height-demo p {
margin: 0 0 12px;
}
@media (max-width: 600px) {
.column-height-demo .column-content {
column-count: 1;
column-height: auto;
}
}
Experimental Column Height
HTML provides the structure of a web page.
CSS controls the visual presentation of content.
Selectors identify the elements to style.
Properties define how elements are displayed.
Grid and Flexbox organize interface layouts.
Multi-column layout divides flowing content.
Media queries adapt designs to screen sizes.
Responsive layouts improve readability.
In browsers implementing CSS Multi-column Layout Level 2, the specified height can produce multiple rows of columns when the content exceeds the available space.
In browsers without support, the content continues to use the established multi-column layout. The example therefore remains readable even when the experimental declarations have no effect.
The exact appearance depends on browser support, available width, font metrics, and content length.
Fallbacks
Because column-height is experimental, production layouts should provide a usable fallback.
Basic Fallback
.article {
column-count: 2;
column-gap: 24px;
column-height: 300px;
}
Browsers that do not recognize column-height ignore that declaration while preserving the supported column count and gap.
Feature Detection
.article {
column-count: 2;
column-gap: 24px;
}
@supports (column-height: 300px) {
.article {
column-height: 300px;
column-wrap: wrap;
}
}
The @supports rule can detect whether a browser recognizes the property. Recognition does not guarantee that every aspect of the proposed layout behavior is implemented correctly.
Alternative with Standard CSS
.article {
column-width: 240px;
column-gap: 24px;
column-fill: balance;
}
This uses established multi-column properties and allows the browser to determine the content height.
Fixed-Height Alternative
.article {
height: 300px;
column-count: 2;
column-fill: auto;
overflow-x: auto;
}
This creates a height-constrained layout using existing CSS, but excess columns may require horizontal scrolling. It is not equivalent to wrapped column rows.
Recommended Approach
Keep the fallback layout readable without relying on experimental wrapping. Add column-height only as an enhancement where its behavior is supported.
Accessibility
Controlling column height can reduce excessive vertical reading distances, but multi-column layouts still require careful accessibility testing.
Avoid Extremely Tall Columns
Long columns can require users to scroll down and then return to the top to continue reading.
Maintain Readable Widths
Use suitable column widths so text does not wrap into excessively short lines.
Preserve Logical Reading Order
CSS columns change the visual arrangement of content without changing its underlying HTML order.
Test Browser Zoom
Check the layout at increased text sizes and zoom levels to ensure that content remains visible and readable.
Avoid Clipping Content
Do not use overflow clipping that makes additional columns or rows inaccessible.
Use Responsive Layouts
Consider switching to a single column on narrow screens, especially when experimental wrapping is unavailable.
Provide Fallbacks
Ensure the content remains accessible in browsers that ignore column-height.
Important Considerations
Keep the following points in mind when using column-height:
- Purpose: Specifies the desired height of columns in a multi-column layout.
- Status: Experimental CSS Multi-column Layout Level 2 feature.
- Initial value:
auto. - Inheritance: The property is not inherited.
- Valid values:
autoand non-negative CSS lengths. - Invalid values: Negative lengths and percentages.
- auto: Allows column height to be determined by content and layout constraints.
- Length values: Specify a desired column height.
- column-wrap: Controls whether additional columns wrap into another row.
- Automatic wrapping: A length-based column height causes
column-wrap: autoto resolve towrap. - column-count: Controls the desired number of columns.
- column-width: Controls the preferred column width.
- columns shorthand: Level 2 adds an optional height value after a slash.
- Container height:
heightandcolumn-heightare not interchangeable. - column-fill: Influences how content is distributed among columns.
- row-gap: Can specify spacing between wrapped rows of columns.
- Fragmentation: Oversized or unbreakable content may overflow the desired height.
- Browser support: Limited and not consistent across major browsers.
- Fallbacks: Use established multi-column properties for unsupported browsers.
- Accessibility: Maintain readable column widths, reasonable heights, and accessible content flow.
The property offers a more direct way to control column height, but its limited availability makes progressive enhancement important. Avoid relying on it as the only means of controlling a production layout.
Browser Support
The column-height property has limited availability and is not supported consistently across major browsers. It is an experimental feature associated with CSS Multi-column Layout Level 2.
Some Chromium-based browser versions have begun implementing the feature, but Firefox and Safari do not provide equivalent general support. Test the property in your target browsers before using it in production.
Experimental Example
.article {
column-count: 3;
column-height: 300px;
}
Feature Detection
@supports (column-height: 300px) {
.article {
column-height: 300px;
column-wrap: wrap;
}
}
Fallback Example
.article {
column-width: 240px;
column-gap: 24px;
}
@supports (column-height: 300px) {
.article {
column-height: 300px;
column-wrap: wrap;
}
}
Compatibility Considerations
Test the property alongside column-wrap, column-fill, and the extended columns shorthand. Support for one part of the newer multi-column model does not necessarily guarantee complete support for every related feature.
For current compatibility information, visit Can I Use? and search for column-height.
Specifications
The column-height property is defined in CSS Multi-column Layout Module Level 2.
CSS Multi-column Layout Module Level 2
The specification defines automatic and length-based column heights and describes how column height interacts with column wrapping, column sizing, and fragmentation.
