Properti HTML DOM Style borderBottomWidth
gaya Objects
Definisi dan Penggunaan
borderBottomWidth set properti atau mengembalikan lebar batas bawah dari elemen.
tatabahasa
Pengaturan properti borderBottomWidth:
Object.style.borderBottomWidth="thin|medium|thick|length|inherit"
Sifat Kembali borderBottomWidth:
Object.style.borderBottomWidth
值 | 描述 |
---|---|
thin | 定义细的边框。 |
medium | 默认。定义中等的边框。 |
thick | 定义粗的边框。 |
length | 使用 px、cm 等单位定义边框的宽度。 |
inherit | 下边框的宽度从父元素继承。 |
Dukungan Browser
Semua browser utama mendukung properti borderBottomWidth.
Catatan: IE7 dan versi sebelumnya tidak mendukung "mewarisi" nilai.IE8 hanya menyediakan! DOCTYPE didukung "mewarisi". dukungan IE9 "mewarisi".
contoh
contoh
Mengubah lebar perbatasan bawah:
<html>
<head>
<style type="text/css">
#ex1
{
border: 1px solid #FF0000;
}
</style>
<script>
function displayResult()
{
document.getElementById("ex1").style.borderBottomWidth="thick";
}
</script>
</head>
<body>
<div id="ex1">This is some text.</div>
<br>
<button type="button" onclick="displayResult()">Change width of bottom border</button>
</body>
</html>
<head>
<style type="text/css">
#ex1
{
border: 1px solid #FF0000;
}
</style>
<script>
function displayResult()
{
document.getElementById("ex1").style.borderBottomWidth="thick";
}
</script>
</head>
<body>
<div id="ex1">This is some text.</div>
<br>
<button type="button" onclick="displayResult()">Change width of bottom border</button>
</body>
</html>
Coba »
gaya Objects