Properti CSS border-left-color
Contoh
Tetapkan warna untuk batas kiri:
div {border-left-color: coral;}
Lebih banyak contoh "Coba Sendiri" di bawah ini.
Definisi dan Penggunaan
Properti border-left-color
menetapkan warna batas kiri elemen.
Catatan: Selalu deklarasikan properti border-style atau
border-left-style
sebelum border-left-color
properti. Elemen harus memiliki batas sebelum Anda dapat mengubah warnanya.
Nilai bawaan: | Warna elemen saat ini |
---|---|
Diwarisi: | tidak |
Animasi: | Ya. Baca tentang animasi |
Versi: kapan: | CSS1 |
Sintaks JavaScript: | objek .style.borderLeftColor="biru" |
Dukungan Peramban
Angka-angka dalam tabel menentukan versi browser pertama yang sepenuhnya mendukung properti.
Property | |||||
---|---|---|---|---|---|
border-left-color | 1.0 | 4.0 | 1.0 | 1.0 | 3.5 |
Sintaks CSS
border-left-color: color|transparent|initial|inherit;
Nilai properti
Value | Description | Play it |
---|---|---|
color | Specifies the color of the left border. Look at CSS Color Values for a complete list of possible color values. Default color is the current color of the element | |
transparent | Specifies that the border color should be transparent | |
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
Tetapkan warna untuk batas kiri dengan nilai HEX:
div {border-left-color: #92a8d1;}
Contoh
Atur warna untuk batas kiri dengan nilai RGB:
div {border-left-color: rgb(201, 76, 76);}
Contoh
Atur warna untuk batas kiri dengan nilai RGBA:
div {border-left-color: rgba(201, 76, 76, 0.3);}
Contoh
Tetapkan warna untuk batas kiri dengan nilai HSL:
div {border-left-color: hsl(89, 43%, 51%);}
Contoh
Tetapkan warna untuk batas kiri dengan nilai HSLA:
div {border-left-color: hsla(89, 43%, 51%, 0.3);}
Contoh
Setel batas kiri transparan:
div {border-left-color: transparent;}
Halaman Terkait
Tutorial CSS: Perbatasan CSS
Referensi CSS: properti border-left
Referensi DOM HTML: properti borderLeftColor