Styl textuDecorationLine Vlastnost
Příklad
Zobrazte prvek čárou přes text:
document.getElementById("demo").style.textDecorationLine = "line-through";
Definice a použití
Vlastnost textDecorationLine nastavuje nebo vrací, jaký typ čáry, pokud nějaký, bude dekorace mít.
Poznámka: TextDecorationLine můžete také nastavit pomocí vlastnosti textDecoration, což je zkrácená vlastnost pro vlastnosti textDecorationLine, textDecorationStyle a textDecorationColor.
Poznámka: Můžete také zkombinovat více než jednu hodnotu, například podtržení a podtržení, abyste zobrazili řádky pod i nad textem.
Podpora prohlížeče
Property | |||||
---|---|---|---|---|---|
textDecorationLine | 57.0 | 79.0 | 36.0 6.0 Moz |
7.0 Webkit | 44.0 |
Syntax
Vraťte vlastnost textDecorationLine:
object.style.textDecorationLine
Nastavte vlastnost textDecorationLine:
object.style.textDecorationLine = "none|underline|overline|line-through|initial|inherit"
Hodnoty vlastností
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 |
Technické údaje
Výchozí hodnota: | žádný |
---|---|
Návratová hodnota: | Řetězec představující vlastnost text-decoration-line prvku |
Verze CSS | CSS3 |
Související stránky
CSS reference: vlastnost text-decoration-line
❮ Objekt stylu