Properti HTML DOM Style borderBottom
Definisi dan Penggunaan
borderBottom properti singkat untuk mengatur atau kembali pada tiga sifat perbatasan terpisah.
Dengan properti ini, Anda dapat mengatur / pulang:
- border-bottom-width
- border-bottom-style
- border-bottom-warna
tatabahasa
Pengaturan properti borderBottom:
Object.style.borderBottom="width style color"
Kembali sifat borderBottom:
Object.style.borderBottom
Tip: properti borderBottomtidak memiliki nilai default.
参数 | 描述 |
---|---|
width | 设置下边框的宽度。 |
style | 设置下边框的样式。 |
color | 设置下边框的颜色。 |
Dukungan Browser
Semua browser utama mendukung properti borderBottom.
contoh
contoh
Mengubah lebar, gaya, dan warna di perbatasan:
<! 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.borderBottom = "tebal solid # 0000FF";
}
</ Script>
</ Kepala>
<Body>
<Div id = "ex1"> Ini adalah beberapa teks. </ Div>
Situs
<Tombol type = "button" onclick = "displayResult ()"> Modify perbatasan bawah </ 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.borderBottom = "tebal solid # 0000FF";
}
</ Script>
</ Kepala>
<Body>
<Div id = "ex1"> Ini adalah beberapa teks. </ Div>
Situs
<Tombol type = "button" onclick = "displayResult ()"> Modify perbatasan bawah </ button>
</ Body>
</ Html>
Coba »
gaya Objects