Gaya borderTopColor Property
Contoh
Ubah warna batas atas elemen <div> menjadi merah:
document.getElementById("myDiv").style.borderTopColor = "red";
Definisi dan Penggunaan
Properti borderTopColor menetapkan atau mengembalikan warna batas atas elemen.
Dukungan Peramban
Property | |||||
---|---|---|---|---|---|
borderTopColor | Yes | Yes | Yes | Yes | Yes |
Sintaksis
Kembalikan properti borderTopColor:
object.style.borderTopColor
Setel properti borderTopColor:
object.style.borderTopColor = "color|transparent|initial|inherit"
Nilai properti
Value | Description |
---|---|
color | Specifies the color of the top border. Look at CSS Color Values for a complete list of possible color values. Default color is the current color of the element |
transparent | The color of the top border is transparent (underlying content will shine through) |
initial | Sets this property to its default value. Read about initial |
inherit | Inherits this property from its parent element. Read about inherit |
Detail Teknis
Nilai Bawaan: | warna saat ini |
---|---|
Nilai Kembali: | Sebuah String, mewakili warna batas atas elemen |
Versi CSS | CSS1 |
Lebih Banyak Contoh
Contoh
Kembalikan warna batas atas elemen <div>:
alert(document.getElementById("myDiv").style.borderTopColor);
Halaman Terkait
Tutorial CSS: Perbatasan CSS
Referensi CSS: properti border-top-color
Referensi DOM HTML: properti perbatasan
Objek Gaya