Properti baris-teks-dekorasi CSS
Contoh
Setel berbagai jenis garis dekorasi teks:
div.a
{
text-decoration-line: overline;
}
div.b
{
text-decoration-line: underline;
}
div.c
{
text-decoration-line: line-through;
}
div.d
{
text-decoration-line: overline underline;
}
Definisi dan Penggunaan
Properti text-decoration-line
mengatur jenis dekorasi teks yang akan digunakan (seperti garis bawah, garis atas, garis tembus).
Tip: Lihat juga properti text-decoration , yang merupakan properti short-hand untuk text-decoration-line, text-decoration-style, dan text-decoration-color.
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.
Nilai bawaan: | tidak ada |
---|---|
Diwarisi: | tidak |
Animasi: | tidak. Baca tentang animasi |
Versi: kapan: | CSS3 |
Sintaks JavaScript: | objek .style.textDecorationLine="overline" |
Dukungan Peramban
Angka-angka dalam tabel menentukan versi browser pertama yang sepenuhnya mendukung properti.
Angka yang diikuti oleh -moz- atau -webkit- menentukan versi pertama yang berfungsi dengan awalan.
Property | |||||
---|---|---|---|---|---|
text-decoration-line | 57.0 | 79.0 | 36.0 6.0 -moz- |
12.1 7.1 -webkit- |
44.0 |
Sintaks CSS
text-decoration-line: none|underline|overline|line-through|initial|inherit;
Nilai properti
Value | Description | Play it |
---|---|---|
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 |
Halaman Terkait
Tutorial CSS: Teks CSS
Referensi DOM HTML: properti textDecorationLine