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