CSS border-right-color property
- Previous page border-right
- Next page border-right-style
Definition and Usage
The border-right-color sets the color of the right border of the element.
Only pure colors can be defined, and the border may only appear when the border style is not none or hidden.
Note:Always declare the border-style attribute before the border-color attribute. The element must have a border before you change its color.
See also:
CSS Tutorial:CSS Borders
CSS Reference Manual:border-right Attribute
HTML DOM Reference Manual:borderRightColor Property
Example
Set the color of the right border:
p { border-style:solid; border-right-color:#ff0000; }
CSS Syntax
border-right-color: color|transparent|initial|inherit;
Attribute Value
Value | Description |
---|---|
color_name | Specifies the border color as a color name (e.g., red). |
hex_number | Specifies the border color as a hexadecimal value (e.g., #ff0000). |
rgb_number | Specifies the border color as an RGB code (e.g., rgb(255,0,0)). |
transparent | Default Value. The border color is transparent. |
inherit | Specifies that the border color should be inherited from the parent element. |
Technical Details
Default Value: | not specified |
---|---|
Inheritance: | no |
Version: | CSS1 |
JavaScript Syntax: | object.style.borderRightColor="blue" |
More examples
- Set the color of the right border
- This example demonstrates how to set the color of the right border.
Browser support
The numbers in the table indicate the first browser version that fully supports this attribute.
Chrome | IE / Edge | Firefox | Safari | Opera |
---|---|---|---|---|
1.0 | 4.0 | 1.0 | 1.0 | 3.5 |
Note:Internet Explorer 6 (and earlier versions) do not support the attribute value "transparent".
Note:Browsers prior to IE7 do not support the value "inherit". IE8 requires !DOCTYPE. IE9 supports "inherit".
- Previous page border-right
- Next page border-right-style