Properti HTML DOM Style borderLeftWidth
Definisi dan Penggunaan
borderLeftWidth set properti atau mengembalikan lebar perbatasan kiri elemen.
tatabahasa
Pengaturan properti borderLeftWidth:
Object.style.borderLeftWidth="thin|medium|thick|length|inherit"
Sifat Kembali borderLeftWidth:
Object.style.borderLeftWidth
值 | 描述 |
---|---|
thin | 定义细的边框。 |
medium | 默认。定义中等的边框。 |
thick | 定义粗的边框。 |
length | 使用 px、cm 等单位定义边框的宽度。 |
inherit | 左边框的宽度从父元素继承。 |
Dukungan Browser
Semua browser utama mendukung properti borderLeftWidth.
Catatan: IE7 dan versi sebelumnya tidak mendukung "mewarisi" nilai.IE8 hanya menyediakan! DOCTYPE didukung "mewarisi". dukungan IE9 "mewarisi".
contoh
contoh
Mengubah lebar perbatasan kiri:
<! DOCTYPE html>
<Html>
<Head>
<Meta charset = "utf-8">
<Title> Tutorial ini (w3big.com) </ title>
<Jenis Style = "text / css">
# EX1 {
border: 1px solid # FF0000;
}
</ Style>
<Script>
Fungsi displayResult () {
document.getElementById ( "ex1") style.borderLeftWidth = "tebal" .;
}
</ Script>
</ Kepala>
<Body>
<Div id = "ex1"> Ini adalah beberapa teks. </ Div>
Situs
<Tombol type = "button" onclick = "displayResult ()"> memodifikasi lebar perbatasan kiri </ button>
</ Body>
</ Html>
<Html>
<Head>
<Meta charset = "utf-8">
<Title> Tutorial ini (w3big.com) </ title>
<Jenis Style = "text / css">
# EX1 {
border: 1px solid # FF0000;
}
</ Style>
<Script>
Fungsi displayResult () {
document.getElementById ( "ex1") style.borderLeftWidth = "tebal" .;
}
</ Script>
</ Kepala>
<Body>
<Div id = "ex1"> Ini adalah beberapa teks. </ Div>
Situs
<Tombol type = "button" onclick = "displayResult ()"> memodifikasi lebar perbatasan kiri </ button>
</ Body>
</ Html>
Coba »
gaya Objects