By using this site you agree to the use of cookies by Brugbart and our partners.

Learn more

CSS Border-right-color Property

Reference on the CSS border-right-color property.

Edited: 2015-12-09 14:52

The border-right-color property is used to control the color of the right border on a HTML element.

Unless you need to specifically target the right border, you may want to consider using the shorthand border property instead. When targeting the right border, you can also use the border-right property, which will allow you to set the style, width and color in one go.

div {
  border-right-color: black;

Possible Values

Read the Colors entry in the referance to understand its many possible values.

Inherited? NO!

Border-right-color example

The CSS border-right-color can be used when setting the right border on a HTML element. It will typically be used in conjunction with border or other orientational border properties.

div {
  border:1px solid black;

In the above example we are combining the use of border-right-color with border, which will first apply a general style to all four borders, and then overwrite the color of the right border. I.e.

It is also possible to target the right border specifically, to do this you can use the border-right-style and border-right-width properties.

div {

Which would result in just the right border showing up:

As you can see, using the properties targeting single borders can result in much more code, it can therefor be a good idea to combine their use with more generally matching properties such as the border property.