/

HTML / CSS / JavaScript Tutorial

CSS Property: column-rule-style

[this page | pdf | back links]

The CSS (CSS3) column-rule-style property specifies the style of any rule between columns.

 

Valid property values (other than inherit and initial) are:

 

Value

Description

dashed

Dashed border

dotted

Dotted border

double

Double border

groove

Effect depends on column-rule-width and column-rule-color values

hidden

Hidden

inset

Effect depends on column-rule-width and column-rule-color values

none

(default value). No border

outset

Effect depends on column-rule-width and column-rule-color values

ridge

Effect depends on column-rule-width and column-rule-color values

solid

Solid border

 

Default Value:

none

JavaScript syntax:

e.g. object.style.columnRuleStyle="dotted"

Inherited:

No

Animatable:

No

 

EXAMPLE:


HTML USED IN THIS EXAMPLE:
<!DOCTYPE html>
<html> <!-- Copyright (c) Nematrian Limited 2018 -->
<head>
<style>
p {width: 200px; column-count: 2;
   column-rule-width: 10px; column-rule-color: red;}
p.x1 {column-rule-style: double}
</style>
</head>
<body>
1. Element with default property<br>
<p>Some text that may be broken into several columns</p><br><br>
2. Element set using in-file HTML style
<p class="x1">Some text that may be broken into several columns</p><br><br>
3. Element set using JavaScript
<p id="x2">Some text that may be broken into several columns</p>

<script>
document.getElementById("x2").style.columnRuleStyle="double";
</script>

</body>
</html>

FUNCTION THAT MAY ASSIST IN TESTING WHETHER FEATURE IS SUPPORTED:
function isSupportedCSSPropertyColumnRuleStyle() {
  var x = document.createElement("DIV"); x.style.columnRuleStyle = "double"; return (window.getComputedStyle(x, null).columnRuleStyle == "double");
}


NAVIGATION LINKS
Contents | Prev | Next | CSS Properties


Desktop view | Switch to Mobile