Stile textDecoration Proprietà
Esempio
Imposta la decorazione del testo per un elemento:
document.getElementById("demo").style.textDecoration = "underline overline";
Definizione e utilizzo
La proprietà textDecoration imposta o restituisce una o più decorazioni per un testo.
Suggerimento: per specificare più di un tipo di decorazione per un elemento, specifica un elenco di tipi di decorazione separati da spazi.
Supporto browser
Property | |||||
---|---|---|---|---|---|
textDecoration | Yes | Yes | Yes | Yes | Yes |
Sintassi
Restituisce la proprietà textDecoration:
object.style.textDecoration
Imposta la proprietà textDecoration:
object.style.textDecoration = "none|underline|overline|line-through|blink|initial|inherit"
Valori di proprietà
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 |
Dettagli tecnici
Valore di default: | nessuno |
---|---|
Valore di ritorno: | Una stringa, che rappresenta la decorazione aggiunta al testo |
Versione CSS | CSS1 |
Altri esempi
Esempio
Restituisce la decorazione del testo di un elemento:
alert(document.getElementById("demo").style.textDecoration);
Pagine correlate
Tutorial CSS: testo CSS
Riferimento CSS: proprietà di decorazione del testo
❮ Oggetto stile