Gaya teksDecorationLine Property
Contoh
Menampilkan elemen dengan garis melalui teks:
document.getElementById("demo").style.textDecorationLine = "line-through";
Definisi dan Penggunaan
Properti textDecorationLine menyetel atau mengembalikan jenis garis apa, jika ada, yang akan dimiliki dekorasi.
Catatan: Anda juga dapat menyetel textDecorationLine menggunakan properti textDecoration, yang merupakan properti short-hand untuk properti textDecorationLine, textDecorationStyle, dan textDecorationColor.
Catatan: Anda juga dapat menggabungkan lebih dari satu nilai, seperti garis bawah dan garis atas untuk menampilkan garis baik di bawah maupun di atas teks.
Dukungan Peramban
Property | |||||
---|---|---|---|---|---|
textDecorationLine | 57.0 | 79.0 | 36.0 6.0 Moz |
7.0 Webkit | 44.0 |
Sintaksis
Kembalikan properti textDecorationLine:
object.style.textDecorationLine
Setel properti textDecorationLine:
object.style.textDecorationLine = "none|underline|overline|line-through|initial|inherit"
Nilai properti
Value | Description |
---|---|
none | Default value. Specifies no line for the text-decoration |
underline | Specifies that a line will be displayed under the text |
overline | Specifies that a line will be displayed over the text |
line-through | Specifies that a line will be displayed 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 properti text-decoration-line dari sebuah elemen |
Versi CSS | CSS3 |
Halaman Terkait
Referensi CSS: properti text-decoration-line
Objek Gaya