CSS columns Property

Description

The columns CSS property is used to control the layout and formatting of multi-column text content within an element. It allows web developers to specify the number of columns, their width, and the gap between them. This property is particularly useful for creating newspaper-style layouts or improving the readability of long blocks of text by breaking them into multiple columns. By adjusting the column-related properties, such as "column-count" for the number of columns, "column-width" for their width, and "column-gap" for the space between columns, designers can achieve a more visually appealing and responsive text presentation on web pages. Individual properties are: column-width and column-count.

Initial value
See individual properties
Applies to
Block level elements
Inherited
No
Computed value
See individual properties
Animatable
No
JavaScript syntax
object.style.columns

Interactive Demo

The rusty swing set creaked a lonely lullaby in the twilight, shadows lengthening like grasping fingers across the dew-kissed grass. 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

columns: <column-width> || <column-count> 

Values

Example

<div class="book">Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.</div>
.book { 
   columns: 150px 3; 
   -moz-columns: 150px 3; 
   -webkit-columns: 150px 3; 
}

Browser Support

The following table will show you the current browser support for the CSS columns property.

Desktop
Edge Chrome Firefox Opera Safari
12505211.19
Tablets / Mobile
Chrome Firefox Opera Safari Samsung Webview
505211.19550

Last updated by CSSPortal on: 1st January 2024