مربع النمط : خاصية الظل
مثال
أضف مربع الظل إلى عنصر div:
document.getElementById("myDIV").style.boxShadow = "10px 20px 30px blue";
التعريف والاستخدام
تقوم الخاصية boxShadow بتعيين أو إرجاع الظلال المسقطة لعنصر مربع.
دعم المتصفح
Property | |||||
---|---|---|---|---|---|
boxShadow | Yes | 9.0 | Yes | 5.1.1 | Yes |
بناء الجملة
إعادة المربع خاصية الظل:
object.style.boxShadow
اضبط المربع خاصية الظل:
object.style.boxShadow = "none|h-shadow v-shadow blur spread color |inset|initial|inherit"
ملاحظة: تقوم خاصية boxShadow بإرفاق ظل أو أكثر من ظلال الإسقاط بالمربع. الخاصية عبارة عن قائمة من الظلال مفصولة بفواصل ، كل منها محدد بقيم طول 2-4 ، ولون اختياري ، وكلمة أساسية اختيارية داخلية. الأطوال المحذوفة هي 0.
قيم الملكية
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 |
تفاصيل تقنية
القيمة الافتراضية: | لا أحد |
---|---|
قيمة الإرجاع: | سلسلة ، تمثل خاصية box-shadow لعنصر |
إصدار CSS | CSS3 |
الصفحات ذات الصلة
مرجع CSS: خاصية box-shadow
❮ نمط الكائن