Styl teksDecoration Property
Voorbeeld
Stel die teksversiering vir 'n element:
document.getElementById("demo").style.textDecoration = "underline overline";
Definisie en gebruik
Die textDecoration-eienskap stel of gee een of meer versierings vir 'n teks terug.
Wenk: Om meer as een versieringstipe vir 'n element te spesifiseer, spesifiseer 'n spasie-geskeide lys versieringtipes.
Blaaierondersteuning
Property | |||||
---|---|---|---|---|---|
textDecoration | Yes | Yes | Yes | Yes | Yes |
Sintaksis
Gee die textDecoration-eienskap terug:
object.style.textDecoration
Stel die textDecoration-eienskap:
object.style.textDecoration = "none|underline|overline|line-through|blink|initial|inherit"
Eiendomswaardes
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 |
Tegniese besonderhede
Standaard waarde: | geen |
---|---|
Terugkeerwaarde: | 'n String, wat die versiering verteenwoordig wat by die teks gevoeg is |
CSS weergawe | CSS1 |
Meer voorbeelde
Voorbeeld
Gee die teksversiering van 'n element terug:
alert(document.getElementById("demo").style.textDecoration);
Verwante bladsye
CSS-tutoriaal: CSS-teks
CSS verwysing: teks-versiering eiendom
❮ Stylvoorwerp