CSS outline-color Property
Contoh
Mengatur warna untuk garis besar:
div {outline-color: coral;}
Lebih banyak contoh "Coba Sendiri" di bawah ini.
Definisi dan Penggunaan
Garis besar adalah garis yang digambar di sekitar elemen, di luar batas, untuk membuat elemen "menonjol".
Properti outline-color
menentukan warna garis besar.
Catatan: Selalu deklarasikan properti outline-style sebelum
outline-color
properti. Sebuah elemen harus memiliki outline sebelum Anda mengubah warnanya.
Nilai bawaan: | balikkan jika didukung, jika tidak warna saat ini |
---|---|
Diwarisi: | tidak |
Animasi: | ya, lihat properti individu . Baca tentang animasi |
Versi: kapan: | CSS2 |
Sintaks JavaScript: | objek .style.outlineColor="#FF0000" |
Tips dan Catatan
Catatan: Garis besar berbeda dari batas ! Tidak seperti batas, kerangka digambar di luar batas elemen, dan mungkin tumpang tindih dengan konten lain. Juga, garis besar BUKAN merupakan bagian dari dimensi elemen; lebar dan tinggi total elemen tidak terpengaruh oleh lebar kerangka.
Dukungan Peramban
Angka-angka dalam tabel menentukan versi browser pertama yang sepenuhnya mendukung properti.
Property | |||||
---|---|---|---|---|---|
outline-color | 1.0 | 8.0 | 1.5 | 1.2 | 7.0 |
Catatan: Nilai invert
ini tidak didukung di browser apa pun, kecuali Internet Explorer 8.
Sintaks CSS
outline-color: invert|color|initial|inherit;
Nilai properti
Value | Description | Play it |
---|---|---|
invert | Performs a color inversion. This ensures that the outline is visible, regardless of color background. Note: Browsers are not required to support this value. | |
color | Specifies the color of the outline. Look at CSS Color Values for a complete list of possible color values. | |
initial | Sets this property to its default value. Read about initial | |
inherit | Inherits this property from its parent element. Read about inherit |
Lebih Banyak Contoh
Contoh
Atur warna untuk garis luar dengan nilai HEX:
div {outline-color: #92a8d1;}
Contoh
Atur warna untuk garis luar dengan nilai RGB:
div {outline-color: rgb(201, 76, 76);}
Contoh
Atur warna untuk garis luar dengan nilai RGBA:
div {outline-color: rgba(201, 76, 76, 0.3);}
Contoh
Atur warna untuk garis luar dengan nilai HSL:
div {outline-color: hsl(89, 43%, 51%);}
Contoh
Atur warna untuk garis luar dengan nilai HSLA:
div {outline-color: hsla(89, 43%, 51%, 0.3);}
Halaman Terkait
Tutorial CSS: Garis Besar CSS
Referensi CSS: properti garis besar
Referensi HTML DOM: properti outlineColor