خاصية زخرفة النص CSS
مثال
عيّن زخارف نصية مختلفة لعناصر <h1> و <h2> و <h3>:
h1 {
text-decoration: overline;
}
h2 {
text-decoration: line-through;
}
h3 {
text-decoration: underline;
}
h4 {
text-decoration: underline
overline;
}
المزيد من الأمثلة "جربها بنفسك" أدناه.
التعريف والاستخدام
تحدد الخاصية الزخرفة text-decoration
المضافة إلى النص ، وهي خاصية اختصار لـ:
- سطر زخرفة النص (مطلوب)
- زخرفة النص اللون
- زخرفة النص
القيمة الافتراضية: | لا شيء الحالياللون صلب |
---|---|
وارث: | رقم |
متحرك: | لا ، انظر الخصائص الفردية . اقرأ عن animatable |
الإصدار: | CSS1 ، تم تجديده في CSS3 |
بناء جملة JavaScript: | الكائن .style.textDecoration = "تسطير" |
دعم المتصفح
تحدد الأرقام الواردة في الجدول إصدار المتصفح الأول الذي يدعم الخاصية بالكامل.
Property | |||||
---|---|---|---|---|---|
text-decoration | 1.0 | 3.0 | 1.0 | 1.0 | 3.5 |
بنية CSS
text-decoration: text-decoration-line text-decoration-color
text-decoration-style|initial|inherit;
قيم الملكية
Value | Description |
---|---|
text-decoration-line | Sets the kind of text decoration to use (like underline, overline, line-through) |
text-decoration-color | Sets the color of the text decoration |
text-decoration-style | Sets the style of the text decoration (like solid, wavy, dotted, dashed, double) |
initial | Sets this property to its default value. Read about initial |
inherit | Inherits this property from its parent element. Read about inherit |
مزيد من الأمثلة
مثال
أضف المزيد من زخرفة النص:
h1 {
text-decoration: underline overline dotted red;
}
h2 {
text-decoration: underline overline wavy
blue;
}
الصفحات ذات الصلة
دروس CSS: نص CSS
مرجع DOM HTML: خاصية textDecoration