Stil kutusuShadow Özellik
Örnek
Bir div öğesine kutu gölgesi ekleyin:
document.getElementById("myDIV").style.boxShadow = "10px 20px 30px blue";
Tanım ve Kullanım
boxShadow özelliği, bir kutu öğesinin gölgelerini ayarlar veya döndürür.
Tarayıcı Desteği
Property | |||||
---|---|---|---|---|---|
boxShadow | Yes | 9.0 | Yes | 5.1.1 | Yes |
Sözdizimi
boxShadow özelliğini döndürün:
object.style.boxShadow
boxShadow özelliğini ayarlayın:
object.style.boxShadow = "none|h-shadow v-shadow blur spread color |inset|initial|inherit"
Not: boxShadow özelliği, kutuya bir veya daha fazla alt gölge ekler. Özellik, her biri 2-4 uzunluk değeri, isteğe bağlı bir renk ve isteğe bağlı bir iç metin anahtar sözcüğü ile belirtilen, virgülle ayrılmış bir gölgeler listesidir. Atlanan uzunluklar 0'dır.
Mülk değerleri
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 |
Teknik detaylar
Varsayılan değer: | Yok |
---|---|
Geri dönüş değeri: | Bir öğenin box-shadow özelliğini temsil eden bir String |
CSS Sürümü | CSS3 |
İlgili Sayfalar
CSS referansı: kutu gölge özelliği
❮ Stil Nesnesi