Stile textDecorationLine Proprietà
Esempio
Visualizza un elemento con una linea attraverso il testo:
document.getElementById("demo").style.textDecorationLine = "line-through";
Definizione e utilizzo
La proprietà textDecorationLine imposta o restituisce il tipo di linea, se presente, che avrà la decorazione.
Nota: puoi anche impostare textDecorationLine usando la proprietà textDecoration, che è una proprietà abbreviata per le proprietà textDecorationLine, textDecorationStyle e textDecorationColor.
Nota: puoi anche combinare più di un valore, come sottolineato e sopralineato, per visualizzare le righe sia sotto che sopra il testo.
Supporto browser
Property | |||||
---|---|---|---|---|---|
textDecorationLine | 57.0 | 79.0 | 36.0 6.0 Moz |
7.0 Webkit | 44.0 |
Sintassi
Restituisce la proprietà textDecorationLine:
object.style.textDecorationLine
Imposta la proprietà textDecorationLine:
object.style.textDecorationLine = "none|underline|overline|line-through|initial|inherit"
Valori di proprietà
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 |
Dettagli tecnici
Valore di default: | nessuno |
---|---|
Valore di ritorno: | Una stringa, che rappresenta la proprietà della linea di decorazione del testo di un elemento |
Versione CSS | CSS3 |
Pagine correlate
Riferimento CSS: proprietà text-decoration-line
❮ Oggetto stile