Properti HTML DOM Style borderLeft
Definisi dan Penggunaan
borderLeft properti singkat untuk mengatur atau kembali perbatasan meninggalkan tiga sifat independen.
Dengan properti ini, Anda dapat mengatur / pulang:
- perbatasan-kiri-lebar
- perbatasan-kiri-gaya
- perbatasan-kiri-warna
tatabahasa
Pengaturan properti borderLeft:
Object.style.borderLeft="width style color"
Sifat Kembali borderLeft:
Object.style.borderLeft
Tip: borderLeft properti tidak memiliki nilai default.
参数 | 描述 |
---|---|
width | 设置左边框的宽度。 |
style | 设置左边框的样式。 |
color | 设置左边框的颜色。 |
Dukungan Browser
Semua browser utama mendukung properti borderLeft.
contoh
contoh
Mengubah lebar kiri perbatasan, gaya, dan warna:
<! DOCTYPE html>
<Html>
<Head>
<Meta charset = "utf-8">
<Title> Tutorial ini (w3big.com) </ title>
<Jenis Style = "text / css">
# EX1 {
border: tipis dotted # FF0000;
}
</ Style>
<Script>
Fungsi displayResult () {
. Document.getElementById ( "ex1") style.borderLeft = "tebal solid # 0000FF";
}
</ Script>
</ Kepala>
<Body>
<Div id = "ex1"> Ini adalah beberapa teks. </ Div>
Situs
<Tombol type = "button" onclick = "displayResult ()"> Modify perbatasan kiri </ button>
</ Body>
</ Html>
<Html>
<Head>
<Meta charset = "utf-8">
<Title> Tutorial ini (w3big.com) </ title>
<Jenis Style = "text / css">
# EX1 {
border: tipis dotted # FF0000;
}
</ Style>
<Script>
Fungsi displayResult () {
. Document.getElementById ( "ex1") style.borderLeft = "tebal solid # 0000FF";
}
</ Script>
</ Kepala>
<Body>
<Div id = "ex1"> Ini adalah beberapa teks. </ Div>
Situs
<Tombol type = "button" onclick = "displayResult ()"> Modify perbatasan kiri </ button>
</ Body>
</ Html>
Coba »
gaya Objects