Easy Tutorial
❮ Prop Checkbox Value Event Onmouseout ❯

Style borderTopColor Property


Definition and Usage

The borderTopColor property sets or returns the color of the top border of an element.

Syntax

Set the borderTopColor property:

Return the borderTopColor property:

Tip: The borderTopColor property has no default value.

Value Description
color Specifies the color of the top border. In CSS Color Values
transparent The color of the top border is transparent (the underlying content will show through).
inherit The color of the top border is inherited from the parent element.

Browser Support

All major browsers support the borderTopColor property.

Note: IE7 and earlier versions do not support the "inherit" value. IE8 requires a !DOCTYPE to support "inherit". IE9 supports "inherit".


Example

Change the color of the top border:

<!DOCTYPE html>
<html>
<head> 
<meta charset="utf-8"> 
<title>tutorialpro.org(tutorialpro.org)</title> 
<style type="text/css">
#ex1{
    border: 1px solid #FF0000;
}
</style>
<script>
function displayResult(){
    document.getElementById("ex1").style.borderTopColor="#00FF00";
}
</script>
</head>
<body>

<div id="ex1">This is some text.</div>
<br>
<button type="button" onclick="displayResult()">Change top border color</button>

</body>
</html>

❮ Prop Checkbox Value Event Onmouseout ❯