CSS border-right-color

The border-right-color property sets the color of an element's right border. The color is only visible when the right border has a style and a width.

Syntax

border-right-color: currentColor;
border-right-color: #2563eb;
border-right-color: rgb(37, 99, 235);

Example

.status {
  border-right: 0.4rem solid #22c55e;
  padding: 1rem;
}
Result:
Saved successfully

Practical notes

The default value is currentColor, which means the border uses the element's text color unless you set a different one. This can be useful for icons, badges and components that should inherit a theme color.

For layouts that must follow writing direction, consider border-inline-end-color instead of the physical right side.

Common mistake

Changing only the color is not enough if border-right-style is still none. CSS is literal like that.

Related CSS topics