Garis besar gayaProperti Warna
Contoh
Ubah warna garis luar elemen <div>:
document.getElementById("myDiv").style.outlineColor = "#00ff00";
Definisi dan Penggunaan
Properti outlineColor mengatur atau mengembalikan warna kerangka di sekitar elemen.
Garis adalah garis di sekitar elemen. Ini ditampilkan di sekitar margin elemen. Namun, berbeda dengan properti perbatasan.
Outline bukan merupakan bagian dari dimensi elemen, oleh karena itu properti width dan height elemen tidak memuat lebar outline.
Dukungan Peramban
Property | |||||
---|---|---|---|---|---|
outlineColor | Yes | Yes | Yes | Yes | Yes |
Sintaksis
Kembalikan properti outlineColor:
object.style.outlineColor
Setel properti outlineColor:
object.style.outlineColor = "color|invert|initial|inherit"
Nilai properti
Value | Description |
---|---|
color | Specifies the color of the outline. Look at CSS Color Values for a complete list of possible color values |
invert | Inverts the color of the outline to the opposite value. Note: Browsers are not required to support this value |
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: | membalikkan |
---|---|
Nilai Kembali: | Sebuah String, mewakili warna garis elemen |
Versi CSS | CSS2 |
Lebih Banyak Contoh
Contoh
Kembalikan warna batas elemen <div>:
alert(document.getElementById("myDiv").style.outlineColor);
Halaman Terkait
Tutorial CSS: Garis Besar CSS
Referensi CSS: properti garis-warna
Referensi DOM HTML: properti garis besar
Objek Gaya