Categories
CSS Web development

CSS column-rule Property

CSS column-rule Property

The CSS color-rule property sets the style, color and width of the rule between columns.

Syntax:

column-rule: column-rule-width column-rule-style column-rule-color;

column-rule-width – sets the width of the rule between columns.

column-rule-style – sets the style of the rule between columns.

column-rule-color – sets the color of the rule between columns.

column-rule: 5px solid #e76f51;

is a shorthand for:

column-rule-style: solid;
column-rule-width: 5px;
column-rule-color: #e76f51;

Example:

<!DOCTYPE html>
<html>
<head>
<style> 
.text {
  column-count: 3;
  column-gap: 40px;
  column-rule: 5px solid #e76f51;
}
</style>
</head>
<body>

<h4>The column-rule Property:</h4>

<div class="text">
Lorem ipsum dolor sit amet, consectetuer adipiscing elit, sed diam nonummy nibh euismod tincidunt ut laoreet dolore magna aliquam erat volutpat. Ut wisi enim ad minim veniam, quis nostrud exerci tation ullamcorper suscipit lobortis nisl ut aliquip ex ea commodo consequat. Duis autem vel eum iriure dolor in hendrerit in vulputate velit esse molestie consequat, vel illum dolore eu feugiat nulla facilisis at vero eros et accumsan et iusto odio dignissim qui blandit praesent luptatum zzril delenit augue duis dolore te feugait nulla facilisi. 
</div>

</body>
</html>

Output:

The column-rule Property:

Lorem ipsum dolor sit amet, consectetuer adipiscing elit, sed diam nonummy nibh euismod tincidunt ut laoreet dolore magna aliquam erat volutpat. Ut wisi enim ad minim veniam, quis nostrud exerci tation ullamcorper suscipit lobortis nisl ut aliquip ex ea commodo consequat. Duis autem vel eum iriure dolor in hendrerit in vulputate velit esse molestie consequat, vel illum dolore eu feugiat nulla facilisis at vero eros et accumsan et iusto odio dignissim qui blandit praesent luptatum zzril delenit augue duis dolore te feugait nulla facilisi.

Enjoy coding!