Style columnsProperty

Style 对象参考手册Style Object

Example

Divide the text into three columns, each column at least 100 pixels:

document.getElementById("myDIV").style.columns="100px 3";

Try it Yourself »

Definition and Usage

The columns property is a shorthand property for setting columnWidth and columnCount.


Browser Support

Internet Explorer Firefox Opera Google Chrome Safari

Internet Explorer 10 and Opera support the columns property.

Firefox supports an alternative property, the MozColumns property.

Safari and Chrome support an alternative property, the WebkitColumns property.


Syntax

Return the columns property:

object.style.columns

Set the columns property:

object.style.columns="auto|column-width column-count|initial|inherit"

Property Values

Value Description
auto Default value. Sets column-width to "auto" and column-count to "auto".
columnWidth The width of the columns.
columnCount The number of columns.
initial Sets this property to its default value. Seeinitial。
inherit Inherits this property from its parent element. Seeinherit。

Technical Details

Default Value: auto auto
Return Value: A string representing the columns property of an element.
CSS Version CSS3


Related Articles

CSS3 Tutorial:CSS3 Multiple Columns

CSS Reference Manual:columns property


Style 对象参考手册Style Object

Other Extensions