CSS border-right-width property

Definition and usage

The border-right-width property sets the width of the element's right border.

Only takes effect when the border style is not none. If the border style is none, the border width will actually reset to 0. Negative length values are not allowed.

Note:Always declare the border-style property before the border-right-width property. The element must have a border before its width can be changed.

See also:

CSS Tutorial:CSS Borders

CSS Reference Manual:border-right property

HTML DOM Reference Manual:borderRightWidth property

Example

Set the width of the right border:

p
  {
  border-style:solid;
  border-right-width:15px;
  }

Try it yourself

CSS syntax

border-right-width: medium|thin|thick|length|initial|inherit;

Property value

Value Description
thin Defines a thin right border.
medium Default value. Defines a medium right border.
thick Defines a thick right border.
length Allows you to customize the width of the right border.
inherit Specifies that the border width should be inherited from the parent element.

Technical details

Default value: medium
Inheritance: no
Version: CSS1
JavaScript syntax: object.style.borderRightWidth="thick"

More examples

Set the width of the right border
This example demonstrates how to set the width of the right border.

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:Browsers with IE7 and earlier versions do not support the value "inherit". IE8 requires !DOCTYPE. IE9 supports "inherit".