Knowledge baseExam Center
ENEnglish
Choose language13

CKTIS / CSS

CSS property `row-rule-color`

The `row-rule-color` property assigns colors to successive row-gap decorations. A `red, blue` list repeats across gaps, `repeat()` can abbreviate the pattern, and the initial `currentcolor` takes the container’s current color.

Version: CSS modules; structured CSSWG indexes reconciled with pinned MDN BCD; Chromium 152 scope gate, per-example verification still required

Syntax

<line-color-list> | <auto-line-color-list>

The row-rule-color property assigns colors to successive row-gap decorations. A red, blue list repeats across gaps, repeat() can abbreviate the pattern, and the initial currentcolor takes the container’s current color.

The example sets row-rule-color:red,blue on a three-row grid; Chromium computes a two-item list, and image samples confirm a red first separator and blue second separator without changing layout height.

Grammar: <line-color-list> | <auto-line-color-list>.

Color alone is insufficient: with row-rule-style:none, nothing is painted. The <auto-line-color-list> syntax can fill an unknown number of gaps, but remains part of an evolving Editor’s Draft; test @supports before relying on lists or auto-repeat and keep the layout readable without rules.

Examples

<!doctype html><meta charset="utf-8"><style>html,body{margin:0;background:white}#grid{display:grid;grid-template-rows:20px 20px 20px;row-gap:10px;width:80px;row-rule-width:4px;row-rule-style:solid;row-rule-color:red,blue}</style><div id="grid"><i></i><i></i><i></i></div><pre id="result"></pre><script>const s=getComputedStyle(grid),v=s.rowRuleColor,h=Math.round(grid.getBoundingClientRect().height);if(v!=='rgb(255, 0, 0), rgb(0, 0, 255)'||h!==80)throw new Error('row-rule-color mismatch '+[v,h]);result.textContent='colors='+v+'; height='+h;</script>

Result

colors=rgb(255, 0, 0), rgb(0, 0, 255); height=80

The example sets `row-rule-color:red,blue` on a three-row grid; Chromium computes a two-item list, and image samples confirm a red first separator and blue second separator without changing layout height.

Sources