Stile boxShadow Proprietà
Esempio
Aggiungi un box-shadow a un elemento div:
document.getElementById("myDIV").style.boxShadow = "10px 20px 30px blue";
Definizione e utilizzo
La proprietà boxShadow imposta o restituisce le ombre discendenti di un elemento box.
Supporto browser
Property | |||||
---|---|---|---|---|---|
boxShadow | Yes | 9.0 | Yes | 5.1.1 | Yes |
Sintassi
Restituisce la proprietà boxShadow:
object.style.boxShadow
Imposta la proprietà boxShadow:
object.style.boxShadow = "none|h-shadow v-shadow blur spread color |inset|initial|inherit"
Nota: la proprietà boxShadow associa una o più ombre discendenti al riquadro. La proprietà è un elenco di ombre separate da virgole, ciascuna specificata da 2-4 valori di lunghezza, un colore facoltativo e una parola chiave inset facoltativa. Le lunghezze omesse sono 0.
Valori di proprietà
Value | Description |
---|---|
none | Default value. No shadow is displayed |
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 |
spread | Optional. The size of shadow |
color | Optional. The color of the shadow. The default value is black. Look at CSS Color Values for a complete list of possible color values. Note: In Safari (on PC) the color parameter is required. If you do not specify the color, the shadow is not displayed at all. |
inset | Optional. Changes the shadow from an outer shadow (outset) to an inner shadow |
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à box-shadow di un elemento |
Versione CSS | CSS3 |
Pagine correlate
Riferimento CSS: proprietà box-shadow
❮ Oggetto stile