What is the CSS border-right property?

Overview

The border-right property in CSSCascade Style Sheets is used to define the color, style, and width of the right border.

It is a shorthand property of the following:

  • border-right-width
  • border-right-style
  • border-right-color

Note: It is mandatory to define border-right-style.

Syntax


border-right: border-width border-style border-color|initial|inherit;

Property values

  • border-right-width: This is used to specify the width of the border. Medium is the default value.

  • border-right-style: This has a default value of NULL. It is used to set the style of the border.

  • border-right-color: This is used to set the color of the border.

  • initial: This is used to set the value to its default value.

  • inherit: This is used to inherit property from its parent value.

Example

Explanation

We set the right border’s color to blue. If we want to change the right border’s color, we can do that as well.

Free Resources