Latest web development tutorials

HTML DOM Style columnCount property

Style Object Reference Style Objects

Examples

The div element text is divided into three columns:

document.getElementById("myDIV").style.columnCount=3;

try it"

Definition and Usage

columnCount attribute specifies the number of columns element should be divided.


Browser Support

Internet ExplorerFirefoxOperaGoogle ChromeSafari

Internet Explorer 10 and Opera support columnCount property.

Firefox supports another alternative of the property attribute that MozColumnCount property.

Safari and Chrome support another alternative of the property attribute that WebkitColumnCount property.

Note: Internet Explorer 9 and earlier versions do not support columnCount property.


grammar

Back columnCount properties:

object .style.columnCount

Setting columnCount properties:

object .style.columnCount="number|auto|initial|inherit"

Property Value

描述
number 元素的内容将被划分的最佳列数。
auto 默认值。由其他属性决定列数,比如 "column-width"。
initial 设置该属性为它的默认值。请参阅 initial
inherit 从父元素继承该属性。请参阅 inherit

technical details

Defaults: auto
return value: String representing the column-count property element.
CSS version CSS3


related articles

CSS3 tutorial: CSS3 multi-column

CSS Reference: column-attribute COUNT


Style Object Reference Style Objects