Style borderRight Attribute

Definition and Usage

borderRight Attributes are set or returned in shorthand form, up to three separate right border properties.

Through this property, you can set/return the following one or more (in any order):

See also:

CSS Tutorial:CSS Border

CSS Reference Manual:border-right Property

HTML DOM Reference Manual:border Property

Example

Example 1

Add a right border to the <div> element:

document.getElementById("myDiv").style.borderRight = "thick solid #0000FF";

Try It Yourself

Example 2

Change the width, style, and color of the <div> element's right border:

document.getElementById("myDiv").style.borderLeft = "thin dotted red";

Try It Yourself

Example 3

Returns the border-right property value of the <div> element:

alert(document.getElementById("myDiv").style.borderLeft);

Try It Yourself

Syntax

Returns the borderRight property:

object.style.borderRight

Sets the borderRight property:

object.style.borderRight = "width style color|initial|inherit"

Attribute Value

Value Description
width Sets the width of the right border.
style Sets the style of the right border.
color Sets the color of the right border.
initial Sets this property to its default value. See also initial.
inherit Inherits this property from its parent element. See also inherit.

Technical Details

Default Value: Not Specified
Return Value: A string that represents the width, style, and/or color of the element's right border.
CSS Version: CSS1

Browser Support

Chrome Edge Firefox Safari Opera
Chrome Edge Firefox Safari Opera
Support Support Support Support Support