English | 简体中文 | 繁體中文 | Русский язык | Français | Español | Português | Deutsch | 日本語 | 한국어 | Italiano | بالعربية

CSS Reference Manual

CSS @rules (RULES)

Comprehensive List of CSS Properties

CSS border-right-color Attribute Usage and Example

border-right-The color CSS attribute is used to set the color of the right border of the element. However, in many cases, likeborder-colororborder-rightSuch shorthand CSS properties are more convenient and preferable to use.

The table below provides usage instructions and version history of this attribute, as well as its usage syntax in JavaScript scripts.

Default Value:colorAttribute Value
Applies To:All Elements
Inheritance:No
Animatable:Yes.Please refer to Animation Attribute.
Version:CSS 1,2,3
JavaScript Syntax:object object.style.borderRightColor="red"

border-right-color Syntax Usage

The syntax of this attribute is as follows:

border-right-color: color | transparent | initial | inherit

The following examples demonstrate how to use border-right-color Attribute.

  p {
   border-style: solid;
   border-right-color: #ff0000;
  }
Test and see‹/›

Note:You must beborder-styleAttribute is declared before border-bottom-width Attribute. The element must have a border before it can set the border width, because theborder-styleThe default value of the attribute is none.

Attribute Value

The table below describes the value of this attribute.

ValueDescription
colorSpecify the color of the right border. SeeCSS Color Valuesto get the list of possible color values.
transparentAllow the border to be transparent, although it may take upborder-widthThe space for attribute setting.
initialSet this attribute to its default value.
inheritIf specified, the associated element adopts its parent element's border-right-The value of the color attribute.

Browser Compatibility

border-right-The compatibility of the color attribute across browsers, the numbers in the table below represent the minimum version of the browser that supports this attribute; all mainstream browsers support this attribute.

  • Firefox 1+

  • Google Chrome1+

  • Internet Explorer 4+

  • Apple Safari 1+

  • Opera 4+

Further Reading

See Tutorial:CSS Border,CSS3 Border.

Related Properties:border,border-color,border-right,border-right-style,
border-right-width.