The column-rule-color
property is used to set the color of the rule between columns in a multi-column layout. It is a part of the CSS3 multi-column layout module and is supported by all modern browsers.
The column-rule-color
property can be used in conjunction with the column-rule-width
and column-rule-style
properties to create a custom rule between columns. The default value of column-rule-color
is the same as the font color of the element.
Here is an example of how to use the column-rule-color
property:
<div class="multi-column">
<p>Lorem ipsum dolor sit amet, consectetur adipiscing elit. Sed euismod, velit eget bibendum bibendum, velit elit bibendum elit, vel bibendum elit elit vel elit.</p>
<p>Sed euismod, velit eget bibendum bibendum, velit elit bibendum elit, vel bibendum elit elit vel elit.</p>
<p>Velit elit bibendum elit, vel bibendum elit elit vel elit.</p>
</div>
In this example, we have created a multi-column layout with three columns and a red rule between them. The column-rule-width
and column-rule-style
properties have also been set to create a solid 1px wide rule.
The column-rule-color
property can also be set to transparent to remove the rule between columns:
<div class="multi-column">
<p>Lorem ipsum dolor sit amet, consectetur adipiscing elit. Sed euismod, velit eget bibendum bibendum, velit elit bibendum elit, vel bibendum elit elit vel elit.</p>
<p>Sed euismod, velit eget bibendum bibendum, velit elit bibendum elit, vel bibendum elit elit vel elit.</p>
<p>Velit elit bibendum elit, vel bibendum elit elit vel elit.</p>
</div>
In this example, we have set the column-rule-color
property to transparent, which removes the rule between columns.
It is important to note that the column-rule-color
property only applies to multi-column layouts and will not have any effect on single-column layouts.
Here is a list of possible values for the column-rule-color
property:
color
: Sets the color of the rule between columns. This is the default value.initial
: Sets the property to its default value.inherit
: Inherits the property from its parent element.transparent
: Removes the rule between columns.Overall, the column-rule-color
property is a useful tool for creating custom multi-column layouts with rules between columns. It is easy to use and can be combined with other column properties to create a unique design.