Style borderLeftColorProperty

Style 对象参考手册Style Object

Definition and Usage

The borderLeftColor property sets or returns the color of the element's left border.

Syntax

Set the borderLeftColor property:

Object.style.borderLeftColor="color|transparent|inherit"

Return the borderLeftColor property:

Object.style.borderLeftColor

Tip:The borderLeftColor property has no default value.

Value Description
color Specifies the color of the left border. InCSS color valuesfind a complete list of possible color values.
transparent The color of the left border is transparent (underlying content will show through).
inherit The color of the left border is inherited from the parent element.


Browser Support

Internet ExplorerFirefoxOperaGoogle ChromeSafari

All major browsers support the borderLeftColor property.

Note:IE7 and earlier versions do not support the "inherit" value. IE8 supports "inherit" only if a !DOCTYPE is specified. IE9 supports "inherit".


Example

Example

Change the color of the left border:

<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title>Example Tutorial (example.com)</title>
<style type="text/css">
#ex1{
    border: 1px solid #FF0000;
}
</style>
<script>
function displayResult(){
    document.getElementById("ex1").style.borderLeftColor="#0080FF";
}
</script>
</head>
<body>

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

</body>
</html>

Try it Yourself »


Style 对象参考手册Style Object Other Extensions