row-rule
Limited availability68% of usersExperimental
Draws a line in the gaps between rows of a grid, flex or multi-column layout. It's a shorthand for row-rule-width, row-rule-style and row-rule-color, the same way column-rule works for columns. The line sits inside the gap and takes up no space. It works in Chrome, Edge and Opera so far.
What's modern
From web-features, MDN's browser data and our snippets, checked dailyComingNot in Firefox or Safari yet, so not every major browser supports it.
The old way and the modern waySee the snippet: Grid and flexbox dividers without borders or pseudo-elements →
Old way 15 lines
.grid {
display: grid;
grid-template-columns: repeat(3, 1fr);
gap: 24px;
}
.grid > * {
border-inline-end: 1px solid #ddd;
border-block-end: 1px solid #ddd;
}
.grid > :nth-child(3n) {
border-inline-end: 0;
}
.grid > :nth-last-child(-n + 3) {
border-block-end: 0;
}Modern 7 lines
.grid {
display: grid;
grid-template-columns: repeat(3, 1fr);
gap: 24px;
column-rule: 1px solid #ddd;
row-rule: 1px solid #ddd;
}See how modern your own CSS is.Check your CSS →
Quick facts
- Initial value
See individual properties- Inherited
- No
- Applies to
- Grid, flex, multi-column and grid lanes containers
Quick example
.grid {
display: grid;
grid-template-columns: repeat(3, 1fr);
gap: 24px;
row-rule: 1px solid #ddd;
}Values
row-rule-widthrow-rule-stylerow-rule-colorRelated snippet
Grid and flexbox dividers without borders or pseudo-elementsLayout →row-rule browser support
BaselineLimited availabilityThis feature is not Baseline because it does not work in some of the most widely-used browsers.Not ready for production without a fallback.
Usage68%of people can use this32% use a browser without it.
Browsers
149+
149+Mobile
149+Android