English | 简体中文 | 繁體中文 | Русский язык | Français | Español | Português | Deutsch | 日本語 | 한국어 | Italiano | بالعربية

CSS reference manual

CSS @rules

CSS attribute大全

CSS3 column-rule-width Attribute Usage and Examples

column-rule-The width CSS attribute sets the width of the rule drawn between columns in multi-column layout.

The following table provides usage instructions and version history of this attribute, as well as its usage syntax in JavaScript scripts.

Default Value:medium
Applies To:Multi-column Elements
Inheritance:No
Animatable:Yes.Please refer to Animation Attribute.
Version: CSS3New Feature
JavaScript Syntax:object.style.columnRuleWidth="thin"

column-rule-width Usage Syntax

The syntax of this attribute is as follows:

column-rule-width: length | medium | thin | thick | initial | inherit

The following examples demonstrate how to use column-rule-width Attribute.

p {
    /* Chrome, Safari, Opera */
    -webkit-column-count: 3;
    -webkit-column-gap: 100px;
    -webkit-column-rule-color: red;
    -webkit-column-rule-width: 2px;
    -webkit-column-rule-style: solid;
    /* Firefox */
    -moz-column-count: 3;
    -moz-column-gap: 100px;
    -moz-column-rule-color: red;
    -moz-column-rule-width: 2px;
    -moz-column-rule-style: solid;
    
    column-count: 3;
    column-gap: 100px;
    column-rule-color: red;
    column-rule-width: 2px;
    column-rule-style: solid;
}
Test See‹/›

Attribute Value

The following table describes the values of this attribute.

ValueDescription
lengthLength expressed in absolute or relative units, used to specify the width of the rule.
mediumDefine a medium rule. This is the default value.
thinDefine a thin rule. Width is less than the default value.
thickDefine a strict rule. Width is greater than the default value.
initialSet this attribute to its default value.
inheritIf specified, the associated element uses its parent element column-rule-width Attribute Value.

Browser Compatibility

column-rule-Browser Compatibility of width Attribute, the numbers in the table below represent the minimum version number of the browser that supports this attribute; all mainstream browsers support this attribute.

  • Firefox 2+ -moz-

  • Google Chrome 4+ -webkit-

  • Internet Explorer 10+

  • Apple Safari 3.1+ -webkit-

  • Opera 11.1+ -o-,15+ -webkit-

Further Reading

Please refer to the following tutorials:CSS3Multi-column Layout.

Related Attributes:column-width,column-fill,column-gap,column-rule,column-rule-color,column-rule-style,column-span,column-count,columns.