CSS border-right property

Definition and usage

The border-right shorthand property sets all the properties of the right border in one declaration.

The following properties can be set in order:

If a value is not set, it will not cause any problems, for example, border-right:solid #ff0000; is also allowed.

See also:

CSS Tutorial:CSS Borders

HTML DOM Reference Manual:borderRight property

Example

Set the style of the right border:

p
  {
  border-style:solid;
  border-right:thick double #ff0000;
  }

Try it yourself

CSS syntax

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

Property value

Value Description
border-right-width Specifies the width of the right border. See also:border-right-width possible values.
border-right-style Specifies the style of the right border. See also:border-right-style possible values.
border-right-color Specifies the color of the right border. See also:border-right-color possible values.
inherit Specifies that the border-right property should inherit the settings from the parent element.

Technical details

Default value: not specified
Inheritance: no
Version: CSS1
JavaScript syntax: object.style.borderRight="3px solid blue"

More examples

All right border properties in one declaration
This example demonstrates a shorthand property that sets all right border properties in one declaration.

Browser support

The numbers in the table indicate the first browser version that fully supports this property.

Chrome IE / Edge Firefox Safari Opera
1.0 4.0 1.0 1.0 3.5

Note:IE7 and earlier versions of browsers do not support the value "inherit". IE8 requires !DOCTYPE. IE9 supports "inherit".