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 property before the border-color property. 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 right border color:
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 with color names (e.g., red). |
hex_number | Specifies the border color with hexadecimal values (e.g., #ff0000). |
rgb_number | Specifies the border color with rgb codes (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 right border color
- 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