نمط النص خاصية الظل
مثال
أضف الظل إلى النص:
document.getElementById("demo").style.textShadow = "5px 5px 1px #ff0000, 10px 10px 1px #0000ff";
التعريف والاستخدام
تقوم الخاصية textShadow بتعيين أو إرجاع تأثير ظل واحد أو أكثر للنص.
دعم المتصفح
Property | |||||
---|---|---|---|---|---|
textShadow | Yes | 10.0 | Yes | Yes | Yes |
بناء الجملة
إرجاع خاصية textShadow:
object.style.textShadow
قم بتعيين خاصية textShadow:
object.style.textShadow = "none|h-shadow v-shadow blur color|initial|inherit"
ملاحظة: تقوم خاصية textShadow بإرفاق ظل واحد أو أكثر بالنص. الخاصية عبارة عن قائمة من الظلال مفصولة بفواصل ، يتم تحديد كل منها بقيمتين أو ثلاث قيم طول ولون اختياري. الأطوال المحذوفة هي 0.
قيم الملكية
Value | Description |
---|---|
none | No shadow is drawn. This is default |
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 |
color | Optional. The color of the shadow. Look at CSS Color Values for a complete list of possible color values |
initial | Sets this property to its default value. Read about initial |
inherit | Inherits this property from its parent element. Read about inherit |
تفاصيل تقنية
القيمة الافتراضية: | لا أحد |
---|---|
قيمة الإرجاع: | سلسلة ، تمثل قائمة مفصولة بفواصل من تأثيرات الظل المطبقة على نص العنصر |
إصدار CSS | CSS3 |
مزيد من الأمثلة
مثال
إعادة ظل النص:
alert(document.getElementById("myP").style.textShadow);
الصفحات ذات الصلة
دروس CSS: تأثيرات نص CSS3
مرجع CSS: خاصية ظل النص
❮ نمط الكائن