Rule-width - CSS Property
Summary of characteristics of the rule-width property
medium | thin | thickmediumComputed value: during an animation, the rule-width property gradually changes from one value to another.Per grammar: serialization in the order of syntax.Syntax diagram of rule-width.
In the diagram, the bold terms are the predefined words of CSS, the other terms are described below:
lengthis a numerical value, positive or zero, followed by one of CSS dimension units.- Several values can be listed by separating them with a comma.
Description of the rule-width property.
rule-width with or (2026).
rule-width sets the thickness of the horizontal and vertical lines in a grid container, a flex container, or any other container that displays
blocks in rows and/or columns. These lines separate rows and columns. In the two examples below, a 5px thick line was chosen.
⚠ If that doesn't seem to work, try using another browser, like or .
rule-width on a grid container.rule-width on a flex container.rule-width is a property that allows you to set both the row and column borders at the same time, with the same values, i.e., the two properties below:
It should be noted that the thickness of the borders does not add to the space between the rows or columns. This also means that the borders can overlap the content of the rows or columns. However, since they are behind the content, they will never block reading.
Also remember to set rule-style, otherwise the borders won’t be visible, since the default value of rule-style is none.
Refer to the page on rule which gives a summary of the properties related to separation lines.
Values for rule-width.
- rule-width: 5px;
The lilnes separating the rows and those separating the columns are drawn with the indicated thickness. This can also be one of the predefined values!
medium: a line about 3 pixels thick. Default value.thin: a thin line (about 1 pixel).thick: a thick line (about 5 pixels).
ABCDEFGHIJKLMNOPQRSTUVWXYZrule-width:6px; - rule-width: 6px, 2px; rule-width: 6px, repeat(10, thin);
When multiple values are listed, separated by a comma, each one applies to a horizontal border and a vertical border. If the number of borders is greater than the number of values, the list starts over from the beginning.
The function
repeat()is accepted in the syntax.ABCDEFGHIJKLMNOPQRSTUVWXYZrule-width:6px, repeat(10,2px); - rule-width: initial; (
medium) rule-width: inherit; rule-width: revert; rule-width: revert-layer; rule-width: revert-rule; rule-width: unset;Common values are presented on these pages:
initial,inherit,revert,revert-layer,revert-rule,unset.
Animation of the rule-width property.
The animation of rule-width is continuous, even if you use the preset values because each of them corresponds to a numerical value.
Simulator.
The simulator shows a grid container and a flex-box container from which you can change the value of rule-width.
J
S
Browsers compatibility with rule-width.
The rule-width property is still not widely recognized. For now (2026), only and handle this property.
rule-width, which sets the thickness of the lines between rows and the lines between columns in a grid, a flexbox, etc.column-rule-width, defining the thickness of the column separator line, in the case of a multi-column layout.row-rule-width property, which sets the thickness of the row separators in a grid, flex-box, etc.rule-widthproperty
column-rule-widthproperty
row-rule-widthproperty
Browsers on computers :
Mobile browsers :
Outdated or marginal browsers :

Internet Explorer

UC Browser pour Androïd

Opéra Mobile

QQ Browser

Baidu Browser

Safari

Safari sur IOS

Opéra

Chrome

Edge

Firefox

Chrome pour Androïd

Samsung Internet

Androïd Brower

Firefox pour Androïd

KaiOS Browser

Opéra mini
Historic of the rule-width property.
-
CSS Gap Decorations Module Level 1.
This module covers the rules that define gutters between columns in a multi-column container (grid, flex-box...). It extends these possibilities to gutters between elements arranged in multiple rows, allowing these features to be used on other types of containers. Several properties define how these gutters should be drawn.
Regardingrule-widthIntroduction of therule-widthproperty for flex containers and grid containers.April 17, 2025Working Draft.
See also, about gap decorations.
The specification CSS Gap Decorations Module. that describes rule-width also covers everything about row or column separators. This applies to
flex containers, grid containers, multi-column containers, and any containers that can display blocks in rows or columns.
The following properties are also described in that same module:



