Private archive copy · Unofficial site · Content copyright belongs to Runoob Tutorial and the original authors · View Original

HTML DOM Style columnGap Property

Style columnGap Property

Style Object Reference The Style object

Example

Specifies the gap between columns as 40 pixels:

document.getElementById("myDIV").style.columnGap="50px";

Try it »


Definition and Usage

The columnGap property specifies the gap between columns.

**Note:** If a column-rule is set between columns, it appears in the middle of the gap.


Browser support

Internet Explorer Firefox Opera Google Chrome Safari

Internet Explorer 10 and Opera support the columnGap property.

Firefox supports an alternative property to this one, namely the MozColumnGap property.

Safari and Chrome support an alternative property to this one, namely the WebkitColumnGap property.

**Note:** Internet Explorer 9 and its earlier versions do not support the columnGap property.


Syntax

Return the columnGap property:

object

.style.columnGap

Set the columnGap property:

object

.style.columnGap="

length

|normal|initial|inherit"

Attribute values

Value Description
length Sets the gap between columns to a specified length.
normal Default value. Specifies a normal gap between columns. The value recommended by W3C is 1em.
initial Sets this property to its default value. See initial.
inherit Inherits this property from its parent element. See inherit.

Technical Details

Default value: normal
Return Value: A string that represents the column-gap property of an element.
CSS version CSS3

Related Articles

CSS3 Tutorial:CSS3 Multiple Columns

CSS Reference Manual:column-gap property


Style Object Reference The Style object