Stile textShadow Proprietà
Esempio
Aggiungi ombra a un testo:
document.getElementById("demo").style.textShadow = "5px 5px 1px #ff0000, 10px 10px 1px #0000ff";
Definizione e utilizzo
La proprietà textShadow imposta o restituisce uno o più effetti ombra per un testo.
Supporto browser
Property | |||||
---|---|---|---|---|---|
textShadow | Yes | 10.0 | Yes | Yes | Yes |
Sintassi
Restituisce la proprietà textShadow:
object.style.textShadow
Imposta la proprietà textShadow:
object.style.textShadow = "none|h-shadow v-shadow blur color|initial|inherit"
Nota: la proprietà textShadow allega una o più ombre al testo. La proprietà è un elenco di ombre separate da virgole, ciascuna specificata da 2 o 3 valori di lunghezza e un colore opzionale. Le lunghezze omesse sono 0.
Valori di proprietà
Value | Description |
---|---|
none | No shadow is drawn. This is default |
h-shadow | Required. The position of the horizontal shadow. Negative values are allowed |
v-shadow | Required. The position of the vertical shadow. Negative values are allowed |
blur | Optional. The blur distance |
color | Optional. The color of the shadow. Look at CSS Color Values for a complete list of possible color values |
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 un elenco separato da virgole di effetti ombra applicati al testo dell'elemento |
Versione CSS | CSS3 |
Altri esempi
Esempio
Restituisce l'ombreggiatura del testo:
alert(document.getElementById("myP").style.textShadow);
Pagine correlate
Tutorial CSS: Effetti di testo CSS3
Riferimento CSS: proprietà text-shadow
❮ Oggetto stile