HTML-DOM Stil borderLeftColor Eigenschaft
Definition und Verwendung
BorderLeftColor Eigenschaftssätze oder gibt die Farbe des linken Rand des Elements.
Grammatik
Einstellen borderLeftColor Eigenschaften:
Object.style.borderLeftColor="color|transparent|inherit"
Zurück borderLeftColor Eigenschaften:
Object.style.borderLeftColor
Tipp: borderLeftColor Eigenschaft hat keinen Standardwert.
值 | 描述 |
---|---|
color | 规定左边框的颜色。在 CSS 颜色值 中寻找可能的颜色值的完整列表。 |
transparent | 左边框的颜色是透明的(基本内容将会穿透)。 |
inherit | 左边框的颜色从父元素继承。 |
Browser-Unterstützung
Alle gängigen Browser unterstützen borderLeftColor Eigenschaft.
Hinweis: IE7 und früheren Versionen nicht unterstützen , die "erben" Wert.IE8 bietet nur! DOCTYPE unterstützt "erben". IE9 Unterstützung "erben".
Beispiele
Beispiele
Ändern Sie die Farbe des linken Rand:
<!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>
Versuchen »
Style - Objekte