English | 简体中文 | 繁體中文 | Русский язык | Français | Español | Português | Deutsch | 日本語 | 한국어 | Italiano | بالعربية
olumn-rule CSS attribute specifies a line to be drawn between each column, that is, 'rule'. It is a shorthand attribute for setting a single property, that is, settingcolumn-rule-width,column-rule-styleandcolumn-rule-color.
The following table provides usage instructions and version history of this attribute, as well as its usage syntax in JavaScript scripts.
Default Value: | View All Properties |
---|---|
Applies To: | Multi-column Elements |
Inheritance: | None |
Animatable: | Yes, because some properties of shorthand can be animated.Please refer to Animation Attributes. |
Version: | CSS3new feature |
JavaScript Syntax: | object.style.columnRule="3px outset #ff00ff" |
The syntax of this attribute is as follows:
column-rule: [ column-rule-width column-rule-style column-rule-color [ ] | initial | inherit
The following example demonstrates how to use column-rule Attribute.
p { /* Chrome, Safari, Opera */ -webkit-column-count: 3; -webkit-column-gap: 100px; -webkit-column-rule: 2px solid red; /* Firefox */ -moz-column-count: 3; -moz-column-gap: 100px; -moz-column-rule: 2px solid red; column-count: 3; column-gap: 100px; column-rule: 2px solid red; }Test See‹/›
The following table describes the values of this attribute.
Value | Description |
---|---|
column-rule-width | Set the rule width between columns. The default value is medium. Negative values are not allowed. |
column-rule-style | Set the rule style between columns. The default value is none. |
column-rule-color | Set the rule color between columns. The default value iscolorof the element. |
initial | Set this attribute to its default value. |
inherit | If specified, the associated elements adopt the column of their parent element.-rule Attribute Values. |
column-Browser Compatibility of rule Attribute, the numbers in the following table represent the minimum version number of the browsers that support this attribute; all mainstream browsers support this attribute.
|
Please refer to the following tutorials:CSS3Multi-column Layout.
Related Attributes:column-width,column-fill,column-gap,column-rule-width,column-rule-style,column-rule-color,column-span,column-count,columns.