CSS Property border-right

border-right shorthand property defines the width, color, and style of the right border.


Initial value All elements.
Inherited No.
Version CSS1
JavaScript syntax object.style.borderRight="5px solid red"
Applies to

CSS Syntax

border-right: border-width border-style border-color; 

Property Values

The property values are listed in the following table.

Value Description
border-right-width Set the width of the right border
border-right-style Set the style of the right border
border-right-color Set the color of the right border
inherit Inherit the border-right property from the parent element

Browser compatibility

border-right Yes Yes Yes Yes Yes


An example showing how to use border-right CSS property.

    div {<!-- www. jav  a 2s .c om-->
        border-right: 2px dashed darkkhaki;
        background: lightyellow;

Click to view the demo