نمط النص تحويل الملكية
مثال
تحويل الحرف الأول من كل كلمة في عنصر ما إلى أحرف كبيرة:
document.getElementById("demo").style.textTransform = "capitalize";
التعريف والاستخدام
تعيّن الخاصية textTransform الكتابة بالأحرف الكبيرة للنص أو ترجعها.
تُستخدم هذه الخاصية لتغيير النص إلى أحرف كبيرة أو صغيرة أو كبيرة.
دعم المتصفح
Property | |||||
---|---|---|---|---|---|
textTransform | Yes | Yes | Yes | Yes | Yes |
بناء الجملة
قم بإرجاع خاصية تحويل النص:
object.style.textTransform
قم بتعيين خاصية تحويل النص:
object.style.textTransform = "none|capitalize|uppercase|lowercase|initial|inherit"
قيم الملكية
Value | Description |
---|---|
none | No characters are transformed. This is default |
capitalize | The first character of each word is transformed to uppercase |
uppercase | All characters are transformed to uppercase |
lowercase | All characters are transformed to lowercase |
initial | Sets this property to its default value. Read about initial |
inherit | Inherits this property from its parent element. Read about inherit |
تفاصيل تقنية
القيمة الافتراضية: | لا أحد |
---|---|
قيمة الإرجاع: | سلسلة ، تمثل تحول النص في العنصر |
إصدار CSS | CSS1 |
مزيد من الأمثلة
مثال
تحويل كل الأحرف في عنصر ما إلى أحرف كبيرة:
document.getElementById("demo").style.textTransform = "uppercase";
مثال
إرجاع تحويل النص لعنصر:
alert(document.getElementById("demo").style.textTransform);
الصفحات ذات الصلة
دروس CSS: نص CSS
مرجع CSS: خاصية تحويل النص
❮ نمط الكائن