You are here: Reference > JavaScript > client-side > style handling > properties > browser specific extensions > MozColumnGap

MozColumnGap style property | webkitColumnGap style property

Browser support:
Specifies or retrieves the amount of space between columns.


You can find the related objects in the Supported by objects section below.
MozColumnGap: This property is read/write.
webkitColumnGap: This property is read/write.
CSS page for this property: -moz-column-gap

Possible values:

The type of this property is string.
 One of the following values: 
gap in non-negative length
The width of the gap in length units. For the supported length units, see the length page.
Takes the value of this property from the computed style of the parent element.
Default: 0.

Example HTML code 1:

This example illustrates the use of the -moz-column-gap and the -webkit-column-gap properties:
        .example {
            -moz-column-width: 10em;
            -webkit-column-width: 10em;
            -moz-column-gap: 4em;
            -webkit-column-gap: 4em;
    <div class="example">
        You can specify the space between columns with the 
        -moz-column-gap and the -webkit-column-gap properties.
Did you find this example helpful? yes no

Example HTML code 2:

This example illustrates the use of the MozColumnGap and webkitColumnGap properties in JavaScript:
    <script type="text/javascript">
        function ChangeColumnGap (selectTag) {
            // Returns the index of the selected option
            var whichSelected = selectTag.selectedIndex;

            // Returns the text of the selected option
            var columnGap = selectTag.options[whichSelected].text;

            var div = document.getElementById ("myDiv");

            if ('MozColumnGap' in {
       = columnGap + "em";
            } else if ('webkitColumnGap' in {
       = columnGap + "em";
            } else {
                alert ("Your browser doesn't support this example!");
    <div id="myDiv" style="-moz-column-width: 10em; -webkit-column-width: 10em;">
        Lorem ipsum dolor sit amet, consectetuer adipiscing elit. 
        Sed libero purus, nonummy et, viverra a, vestibulum eu, mauris. 
        Quisque consectetuer venenatis elit. Etiam lorem lectus, 
        lobortis malesuada, elementum quis, consequat at, eros. 
        Ut scelerisque faucibus velit.

    <select onchange="ChangeColumnGap (this);" size="5">
        <option selected="selected" />0
        <option />2
        <option />4
        <option />7
        <option />10
Did you find this example helpful? yes no

Supported by objects:

Related pages:

External links:

User Contributed Comments

Post Content

Post Content