CSS3 columns
Property
Topic: CSS3 Properties ReferencePrev|Next
Description
The columns
CSS property is a shorthand property for setting both the column-width
and the column-count
properties at the same time.
The following table summarizes the usages context and the version history of this property.
Default value: | auto auto ; See individual properties |
---|---|
Applies to: | Non-replaced block-level elements (except table elements), table cells, and inline-block elements |
Inherited: | No |
Animatable: | Yes, as each of the properties of the shorthand is animatable. See animatable properties. |
Version: | New in CSS3 |
Syntax
The syntax of the property is given with:
The example below shows the columns
property in action.
Example
Try this code »p {
-webkit-columns: 150px 3; /* Chrome, Safari, Opera */
-moz-columns: 150px 3; /* Firefox */
columns: 150px 3; /* Standard syntax */
}
Property Values
The following table describes the values of this property.
Value | Description |
---|---|
column-width |
Specifies the optimal width of the column in a multi-column element. |
column-count |
Specifies the optimal number of columns in a multi-column element. |
initial |
Sets this property to its default value. |
inherit |
If specified, the associated element takes the computed value of its parent element columns property. |
Browser Compatibility
The columns
property is supported in all major modern browsers.
Basic Support—
|
Further Reading
See tutorial on: CSS3 Multi-column Layouts.
Related properties: column-span
, column-fill
, column-gap
, column-rule
, column-rule-color
, column-rule-style
, column-rule-width
, column-count
, column-width
.