Styl boxShadow Property
Voorbeeld
Voeg 'n bokskadu by 'n div-element:
document.getElementById("myDIV").style.boxShadow = "10px 20px 30px blue";
Definisie en gebruik
Die boxShadow-eienskap stel of gee die drop-shadows van 'n bokselement terug.
Blaaierondersteuning
Property | |||||
---|---|---|---|---|---|
boxShadow | Yes | 9.0 | Yes | 5.1.1 | Yes |
Sintaksis
Gee die boxShadow-eienskap terug:
object.style.boxShadow
Stel die boxShadow-eienskap:
object.style.boxShadow = "none|h-shadow v-shadow blur spread color |inset|initial|inherit"
Let wel: Die boxShadow-eienskap heg een of meer drop-shadows aan die boks. Die eiendom is 'n komma-geskeide lys van skaduwees, elk gespesifiseer deur 2-4 lengte waardes, 'n opsionele kleur, en 'n opsionele ingevoeg sleutelwoord. Weggelaat lengtes is 0.
Eiendomswaardes
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 |
Tegniese besonderhede
Standaard waarde: | geen |
---|---|
Terugkeerwaarde: | 'n String, wat die bokskadu-eienskap van 'n element voorstel |
CSS weergawe | CSS3 |
Verwante bladsye
CSS verwysing: box-shadow eiendom
❮ Stylvoorwerp