Properti perbatasan CSS
Contoh
Atur gaya batas untuk elemen yang berbeda:
h1 {
border: 5px solid red;
}
h2 {
border: 4px dotted blue;
}
div {
border:
double;
}
Definisi dan Penggunaan
Properti border
adalah properti singkatan untuk:
Jika warna batas dihilangkan, warna yang diterapkan akan menjadi warna teks.
Nilai bawaan: | sedang tidak ada warna |
---|---|
Diwarisi: | tidak |
Animasi: | ya, lihat properti individu . Baca tentang animasi |
Versi: kapan: | CSS1 |
Sintaks JavaScript: | objek .style.border="3px biru solid" |
Dukungan Peramban
Angka-angka dalam tabel menentukan versi browser pertama yang sepenuhnya mendukung properti.
Property | |||||
---|---|---|---|---|---|
border | 1.0 | 4.0 | 1.0 | 1.0 | 3.5 |
Sintaks CSS
border: border-width border-style border-color|initial|inherit;
Nilai properti
Value | Description |
---|---|
border-width | Specifies the width of the border. Default value is "medium" |
border-style | Specifies the style of the border. Default value is "none" |
border-color | Specifies the color of the border. Default value is the color of the text |
initial | Sets this property to its default value. Read about initial |
inherit | Inherits this property from its parent element. Read about inherit |
Halaman Terkait
Tutorial CSS: Perbatasan CSS
Tutorial CSS: Model Kotak CSS
Referensi DOM HTML: properti perbatasan