Tekst styluDecoration Property
Przykład
Ustaw dekorację tekstu dla elementu:
document.getElementById("demo").style.textDecoration = "underline overline";
Definicja i użycie
Właściwość textDecoration ustawia lub zwraca jedną lub więcej dekoracji dla tekstu.
Porada: Aby określić więcej niż jeden typ dekoracji dla elementu, określ rozdzieloną spacjami listę typów dekoracji.
Obsługa przeglądarki
Property | |||||
---|---|---|---|---|---|
textDecoration | Yes | Yes | Yes | Yes | Yes |
Składnia
Zwróć właściwość textDecoration:
object.style.textDecoration
Ustaw właściwość textDecoration:
object.style.textDecoration = "none|underline|overline|line-through|blink|initial|inherit"
Wartości nieruchomości
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 |
Szczegóły techniczne
Domyślna wartość: | Żaden |
---|---|
Wartość zwrotu: | Sznurek reprezentujący dekorację dodaną do tekstu |
Wersja CSS | CSS1 |
Więcej przykładów
Przykład
Zwróć dekorację tekstową elementu:
alert(document.getElementById("demo").style.textDecoration);
Powiązane strony
Samouczek CSS: Tekst CSS
Odniesienie CSS: właściwość text-decoration
❮ Obiekt stylu