CSS - border-top-color Property
Sets the color of an element's top border; default is the color of the element.
Possible Values
color − Any valid color value.
Applies to
All the HTML elements.
DOM Syntax
object.style.borderTopColor = "red";
Always declare the border-top-style or the border-style property before the border-top-color property.
Example
Here is the example which shows effect of this property −
<html> <head> <style> p.example1 {border-style: solid; border-top-color: rgb(255, 0, 0); } p.example2 {border-style: solid; border-top-color: rgba(255, 0, 0,0.4); } p.example3 {border-style: solid; border-top-color: hsl(0, 100%, 50%); } p.example4 {border-style: solid; border-top-color: hsla(0, 100%, 50%, 0.3); } p.example5 {border-style: solid; border-top-color: transparent; } </style> </head> <body> <p class="example1">top border with RGB color value</p> <p class="example2">top border with RGBA color value</p> <p class="example3">top border with HSL color value</p> <p class="example4">top border with HSLA color value</p> <p class="example5">top border with transparent color value</p> </body> </html>
Advertisements
To Continue Learning Please Login
Login with Google