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 value
currentColor
Applies to
All elements
Inherited
No
Media
Visual
Computed value
The computed color
Animatable
Yes
CSS Version
CSS2, CSS3
JavaScript syntax
object.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.

Give it a Try!

Browser Support

Desktop
Explorer Edge Chrome Firefox Opera Safari
412113.51
Tablets / Mobile
Android Chrome Firefox Opera Safari Samsung
118410.11?