HTML DOM Style borderLeftColor property
Definition and Usage
BorderLeftColor property sets or returns the color of the left border of the element.
grammar
Setting borderLeftColor properties:
Object.style.borderLeftColor="color|transparent|inherit"
Back borderLeftColor properties:
Object.style.borderLeftColor
Tip: borderLeftColor property has no default value.
值 | 描述 |
---|---|
color | 规定左边框的颜色。在 CSS 颜色值 中寻找可能的颜色值的完整列表。 |
transparent | 左边框的颜色是透明的(基本内容将会穿透)。 |
inherit | 左边框的颜色从父元素继承。 |
Browser Support
All major browsers support borderLeftColor property.
Note: IE7 and earlier versions do not support the "inherit" value.IE8 only provides! DOCTYPE supported "inherit". IE9 support "inherit".
Examples
Examples
Change the color of the left border:
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title>本教程(w3big.com)</title>
<style type="text/css">
#ex1{
border: 1px solid #FF0000;
}
</style>
<script>
function displayResult(){
document.getElementById("ex1").style.borderLeftColor="#00FF00";
}
</script>
</head>
<body>
<div id="ex1">这是一些文本。</div>
<br>
<button type="button" onclick="displayResult()">修改左边框的颜色</button>
</body>
</html>
<html>
<head>
<meta charset="utf-8">
<title>本教程(w3big.com)</title>
<style type="text/css">
#ex1{
border: 1px solid #FF0000;
}
</style>
<script>
function displayResult(){
document.getElementById("ex1").style.borderLeftColor="#00FF00";
}
</script>
</head>
<body>
<div id="ex1">这是一些文本。</div>
<br>
<button type="button" onclick="displayResult()">修改左边框的颜色</button>
</body>
</html>
try it"
Style Objects