Properti klip latar belakang CSS
Contoh
Tentukan seberapa jauh latar belakang harus diperluas dalam sebuah elemen:
div
{
border: 10px dotted black;
padding: 15px;
background:
lightblue;
background-clip:
padding-box;
}
Definisi dan Penggunaan
Properti background-clip
menentukan seberapa jauh latar belakang (warna atau gambar) harus diperluas dalam suatu elemen.
Nilai bawaan: | kotak perbatasan |
---|---|
Diwarisi: | tidak |
Animasi: | tidak. Baca tentang animasi |
Versi: kapan: | CSS3 |
Sintaks JavaScript: | objek .style.backgroundClip="content-box" |
Dukungan Peramban
Angka-angka dalam tabel menentukan versi browser pertama yang sepenuhnya mendukung properti.
Property | |||||
---|---|---|---|---|---|
background-clip | 4.0 | 9.0 | 4.0 | 3.0 | 10.5 |
Sintaks CSS
background-clip: border-box|padding-box|content-box|initial|inherit;
Nilai properti
Value | Description | Play it |
---|---|---|
border-box | Default value. The background extends behind the border | |
padding-box | The background extends to the inside edge of the border | |
content-box | The background extends to the edge of the content box | |
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: Latar Belakang CSS
Referensi DOM HTML: properti backgroundClip