Teks gaya Properti Dekorasi
Contoh
Mengatur dekorasi teks untuk sebuah elemen:
document.getElementById("demo").style.textDecoration = "underline overline";
Definisi dan Penggunaan
Properti textDecoration menyetel atau mengembalikan satu ore lebih banyak dekorasi untuk sebuah teks.
Tip: Untuk menentukan lebih dari satu jenis dekorasi untuk sebuah elemen, tentukan daftar jenis dekorasi yang dipisahkan spasi.
Dukungan Peramban
Property | |||||
---|---|---|---|---|---|
textDecoration | Yes | Yes | Yes | Yes | Yes |
Sintaksis
Kembalikan properti textDecoration:
object.style.textDecoration
Setel properti textDecoration:
object.style.textDecoration = "none|underline|overline|line-through|blink|initial|inherit"
Nilai properti
Value | Description |
---|---|
none | Defines a normal text. This is default |
underline | Defines a line under the text |
overline | Defines a line over the text |
line-through | Defines a line through the text |
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: | Sebuah String, mewakili dekorasi yang ditambahkan ke teks |
Versi CSS | CSS1 |
Lebih Banyak Contoh
Contoh
Kembalikan dekorasi teks dari sebuah elemen:
alert(document.getElementById("demo").style.textDecoration);
Halaman Terkait
Tutorial CSS: Teks CSS
Referensi CSS: properti dekorasi teks
Objek Gaya