Styl textuDecoration Property
Příklad
Nastavte dekoraci textu pro prvek:
document.getElementById("demo").style.textDecoration = "underline overline";
Definice a použití
Vlastnost textDecoration nastavuje nebo vrací jednu nebo více dekorací pro text.
Tip: Chcete-li pro prvek určit více než jeden typ dekorace, zadejte seznam typů dekorace oddělený mezerami.
Podpora prohlížeče
Property | |||||
---|---|---|---|---|---|
textDecoration | Yes | Yes | Yes | Yes | Yes |
Syntax
Vraťte vlastnost textDecoration:
object.style.textDecoration
Nastavte vlastnost textDecoration:
object.style.textDecoration = "none|underline|overline|line-through|blink|initial|inherit"
Hodnoty vlastností
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 |
Technické údaje
Výchozí hodnota: | žádný |
---|---|
Návratová hodnota: | Řetězec představující ozdobu přidanou k textu |
Verze CSS | CSS1 |
Další příklady
Příklad
Vrátit textovou dekoraci prvku:
alert(document.getElementById("demo").style.textDecoration);
Související stránky
CSS tutoriál: CSS Text
CSS reference: vlastnost text-decoration
❮ Objekt stylu