Properti ketebalan teks-dekorasi-teks CSS
Contoh
Atur ketebalan garis dekorasi yang berbeda untuk elemen <h1>, <h2>, <h3>, dan <h4>:
h1 {
text-decoration: underline;
text-decoration-thickness: auto;
}
h2 {
text-decoration: underline;
text-decoration-thickness: 5px;
}
h3 {
text-decoration: underline;
text-decoration-thickness: 50%;
}
/* Use shorthand property */
h4 {
text-decoration:
underline solid red 50%;
}
Definisi dan Penggunaan
Properti text-decoration-thickness
menentukan ketebalan garis dekorasi.
Nilai bawaan: | mobil |
---|---|
Diwarisi: | tidak |
Animasi: | tidak, lihat properti individu . Baca tentang animasi |
Versi: kapan: | CSS4 |
Sintaks JavaScript: | objek .style.textDecorationThickness="5px" |
Dukungan Peramban
Angka-angka dalam tabel menentukan versi browser pertama yang sepenuhnya mendukung properti.
Property | |||||
---|---|---|---|---|---|
text-decoration-thickness | 89.0 | 89.0 | 70.0 | 12.1 | 75.0 |
Sintaks CSS
text-decoration-thickness:
auto|from-font|length/percentage|initial|inherit;
Nilai properti
Value | Description |
---|---|
auto | The browser chooses the thickness of the decoration line |
from-font | If a font file contains information about a preferred thickness, use that value. If not, behave as auto |
length/percentage | Specifies the thickness as a length or % |
initial | Sets this property to its default value. Read about initial |
inherit | Inherits this property from its parent element. Read about inherit |
Halaman Terkait
Referensi CSS: properti dekorasi teks
Tutorial CSS: Dekorasi Teks CSS