Teks Gaya , Properti Bayangan
Contoh
Tambahkan bayangan ke teks:
document.getElementById("demo").style.textShadow = "5px 5px 1px #ff0000, 10px 10px 1px #0000ff";
Definisi dan Penggunaan
Properti textShadow menyetel atau mengembalikan satu efek bayangan bijih lebih untuk sebuah teks.
Dukungan Peramban
Property | |||||
---|---|---|---|---|---|
textShadow | Yes | 10.0 | Yes | Yes | Yes |
Sintaksis
Kembalikan properti textShadow:
object.style.textShadow
Setel properti textShadow:
object.style.textShadow = "none|h-shadow v-shadow blur color|initial|inherit"
Catatan: Properti textShadow menempelkan satu atau beberapa bayangan ke teks. Properti adalah daftar bayangan yang dipisahkan koma, masing-masing ditentukan oleh 2 atau 3 nilai panjang dan warna opsional. Panjang yang dihilangkan adalah 0.
Nilai properti
Value | Description |
---|---|
none | No shadow is drawn. This is default |
h-shadow | Required. The position of the horizontal shadow. Negative values are allowed |
v-shadow | Required. The position of the vertical shadow. Negative values are allowed |
blur | Optional. The blur distance |
color | Optional. The color of the shadow. 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 |
Detail Teknis
Nilai Bawaan: | tidak ada |
---|---|
Nilai Kembali: | String, mewakili daftar efek bayangan yang dipisahkan koma yang diterapkan pada teks elemen |
Versi CSS | CSS3 |
Lebih Banyak Contoh
Contoh
Kembalikan bayangan teks:
alert(document.getElementById("myP").style.textShadow);
Halaman Terkait
Tutorial CSS: Efek Teks CSS3
Referensi CSS: properti text-shadow
Objek Gaya