CSS border-top-color Property
Description
The border-top-color
property specifies the color of the top border of an element. Note that in many cases the shorthand CSS properties border-color or border-top are more convenient and preferable.
- Initial valuecurrentColor
- Applies toAll elements
- InheritedNo
- MediaVisual
- Computed valueThe computed color
- AnimatableYes
- CSS VersionCSS2, CSS3
- JavaScript syntaxobject.style.borderTopColor
Syntax
Formal syntax: <color> border-top-color: green; border-top-color: #3366FF; border-top-color: rgb(51,102,255); border-top-color: rgba(51,102,255,1); border-top-color: hsl(225,100%,60%); border-top-color: hsla(225,100%,60%,1); border-top-color: transparent;
Values
- <color>The computed value of the 'color' property. This value can be a basic color keyword, such as red or green, a numerical value, an RGB or RGBA value, or an HSL or HSLA value.
- transparentFully transparent. This keyword can be considered a shorthand for transparent black, rgba(0,0,0,0), which is its computed value.
- inherit
Example
.class { border-top-color: #f0f0f0; }
Give it a Try
Click the button below to experiment with this property.
Browser Support
1+![]() | 6+![]() | 1+![]() | 1+![]() | 8+![]() |
View All CSS Properties
Errors? Please help to keep this list up to date, If you find any errors, please contact us, so that we can get them fixed.