CSS Property border-top-color

border-top-color sets the color for the top border.


Inherited No.
Version CSS1
JavaScript syntax object.style.borderTopColor="blue"
Applies to All elements.

CSS Syntax

border-top-color: color | transparent | inherit 

where color is a valid CSS color value.

Property Values

The property values are listed in the following table.

Value Description
color Set the border color.
transparent Set the border color to transparent. Default value
inherit Inherit the border color from the parent element

Browser compatibility

border-top-color Yes Yes Yes Yes Yes


An example showing how to use border-top-color CSS property.

    <style type='text/css'>
    div {<!--from   w  w w  .j  av a2  s . c  o  m-->
        border-top: 3px dashed darkkhaki;

Click to view the demo