HTML DOM Style columns property
Examples
The text is divided into three columns, each a minimum of 100 pixels:
document.getElementById("myDIV").style.columns="100px 3";
try it"
Definition and Usage
columns property is a shorthand property for setting columnWidth and columnCount.
Browser Support
Opera and Internet Explorer 10 support columns property.
Firefox supports another alternative of the property attribute that MozColumns property.
Safari and Chrome support another alternative of the property attribute that WebkitColumns property.
grammar
Back columns attributes:
object .style.columns
Setting columns properties:
object .style.columns="auto|column-width column-count|initial|inherit"
Property Value
值 | 描述 |
---|---|
auto | 默认值。设置 column-width 为 "auto",column-count 为 "auto"。 |
columnWidth | 列的宽度。 |
columnCount | 列数。 |
initial | 设置该属性为它的默认值。请参阅 initial 。 |
inherit | 从父元素继承该属性。请参阅 inherit 。 |
technical details
Defaults: | auto auto |
---|---|
return value: | String representing the columns attribute element. |
CSS version | CSS3 |
related articles
CSS3 tutorial: CSS3 multi-column
CSS Reference: Columns property