What is the CSS border-top-color property?

The border-top-color property in CSSCascade Style Sheets is used to set the color of the top border of the element.


In order to use the border-top-color property, we must use the border-style or the border-top-style property. This is because the color is only changed if you have a border.


Syntax


border-top-color: color|transparent|initial|inherit;

Property values

  • color: This is used to set the color of the top border.

  • transparent: This is used to specify that the color of the border should be transparent.

  • initial: This is used to set the value to its default value.

  • inherit: This is used to inherit property from its parent value.

Code