Pole stylu Shadow Property
Przykład
Dodaj box-shadow do elementu div:
document.getElementById("myDIV").style.boxShadow = "10px 20px 30px blue";
Definicja i użycie
Właściwość boxShadow ustawia lub zwraca cienie elementu box.
Obsługa przeglądarki
Property | |||||
---|---|---|---|---|---|
boxShadow | Yes | 9.0 | Yes | 5.1.1 | Yes |
Składnia
Zwróć właściwość boxShadow:
object.style.boxShadow
Ustaw właściwość boxShadow:
object.style.boxShadow = "none|h-shadow v-shadow blur spread color |inset|initial|inherit"
Uwaga: Właściwość boxShadow dołącza do pudełka jeden lub więcej cieni. Właściwość to rozdzielona przecinkami lista cieni, z których każdy jest określony przez 2-4 wartości długości, opcjonalny kolor i opcjonalne słowo kluczowe wstawki. Pominięte długości to 0.
Wartości nieruchomości
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 |
Szczegóły techniczne
Domyślna wartość: | Żaden |
---|---|
Wartość zwrotu: | String, reprezentujący właściwość box-shadow elementu |
Wersja CSS | CSS3 |
Powiązane strony
Odniesienie CSS: właściwość box-shadow
❮ Obiekt stylu