CSS border-top-color property

CSS border-top-color property

Description

Sets the color of the element’s top border; defaults to the element’s color.

Possible values

  • color − Any valid color value.

Applies to

All HTML elements.

DOM Syntax

object.style.borderTopColor = "red"; 

Example

Here is an example showing the effect of this property:


<style type = "text/css"> 
p.example1 { 
border:1px solid; 
border-bottom-color:#009900; /* Green */ 
border-top-color:#FF0000; /* Red */ border-left-color:#330000; /* Black */ 
border-right-color:#0000CC; /* Blue */ 
} 
</style> 

<p class = "example1"> 
This example is showing top border in red color. 
</p> 

This will produce the following results −

CSS border-top-color property

Leave a Reply

Your email address will not be published. Required fields are marked *