You are here: Reference > JavaScript > client-side > style handling > properties > browser specific extensions > MozColumnGap
MozColumnGap style property | webkitColumnGap style property
MozColumnGap | ||||||
webkitColumnGap |
Specifies or retrieves the amount of space between columns.
Syntax:
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:
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:
|
||||
<head> <style> .example { -moz-column-width: 10em; -webkit-column-width: 10em; -moz-column-gap: 4em; -webkit-column-gap: 4em; } </style> </head> <body> <div class="example"> You can specify the space between columns with the -moz-column-gap and the -webkit-column-gap properties. </div> </body> |
||||
|
||||
Did you find this example helpful?
|
Example HTML code 2:
This example illustrates the use of the MozColumnGap and webkitColumnGap properties in JavaScript:
|
||||
<head> <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 div.style) { div.style.MozColumnGap = columnGap + "em"; } else if ('webkitColumnGap' in div.style) { div.style.webkitColumnGap = columnGap + "em"; } else { alert ("Your browser doesn't support this example!"); } } </script> </head> <body> <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. </div> <select onchange="ChangeColumnGap (this);" size="5"> <option selected="selected" />0 <option />2 <option />4 <option />7 <option />10 </select> </body> |
||||
|
||||
Did you find this example helpful?
|
Supported by objects:
CSSStyleDeclaration, htmlElement.style
HTML elements:
a, abbr, acronym, address, b, bdo, big, blink, blockquote, body, caption, center, cite, code, dd, del, dfn, dir, div, dl, dt, em, fieldset, font, form, h1, h2, h3, h4, h5, h6, html, i, ins, isindex, kbd, label, legend, li, marquee, menu, ol, p, pre, q, s, samp, small, span, strike, strong, sub, sup, table, td, textarea, th, tt, u, ul, var, xmp
Related pages:
External links:
User Contributed Comments