VOOZH about

URL: https://www.geeksforgeeks.org/css/css-border-top-color-property/

⇱ CSS border-top-color Property - GeeksforGeeks


  • Courses
  • Tutorials
  • Interview Prep

CSS border-top-color Property

Last Updated : 15 May, 2026

The border-top-color property in CSS is used to define the color of the top border of an element. It controls the visual appearance of the border by specifying its color.

  • It accepts color values like red, #ff0000, rgb(), hsl(), or transparent.
  • The color is visible only when a border style is applied (e.g., solid, dashed).
  • It is commonly used with border-top-style and border-top-width for complete border styling.

Syntax:

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

Default Value :  The current color of the element

Property Values:

  • color: It sets the color of the Element’s top-border. 
  • Transparent: It specifies the transparent value of top-border.
  • initial: It sets the Property to its default value.

Example: Here, we are using the border-top-color: color property.


Example:  Here, we are using the border-top-color: transparent; property.


Example: Here, we are using the border-top-color: initial; property.


Comment
Article Tags: