Style borderTopColor Property
- Previous Page borderTop
- Next Page borderTopLeftRadius
- Go to the Previous Level HTML DOM Style Object
Definition and Usage
borderTopColor
Sets or returns the color of the element's top border.
See Also:
CSS Tutorial:CSS Border
CSS Reference Manual:border-top-color Property
HTML DOM Reference Manual:border Property
Example
Example 1
Changes the top border color of the <div> element to red:
document.getElementById("myDiv").style.borderTopColor = "red";
Example 2
Returns the top border color of the <div> element:
alert(document.getElementById("myDiv").style.borderTopColor);
Syntax
Return borderTopColor Property:
object.style.borderTopColor
Set borderTopColor Property:
object.style.borderTopColor = "color|transparent|initial|inherit"
Property Value
Value | Description |
---|---|
color |
Specifies the color of the top border. The default color is black. See CSS Color Values, for a complete list of possible color values. |
transparent | The top border color is transparent (the underlying content will show through). |
initial | Sets this property to its default value. See initial. |
inherit | Inherits this property from its parent element. See inherit. |
Technical Details
Default Value: | black |
---|---|
Return Value: | A string representing the color of the element's top border. |
CSS Version: | CSS1 |
Browser Support
Chrome | Edge | Firefox | Safari | Opera |
---|---|---|---|---|
Chrome | Edge | Firefox | Safari | Opera |
Support | Support | Support | Support | Support |
- Previous Page borderTop
- Next Page borderTopLeftRadius
- Go to the Previous Level HTML DOM Style Object