خط النمط ارتفاع الممتلكات
مثال
اضبط ارتفاع السطر لعنصر <div>:
document.getElementById("myDiv").style.lineHeight = "3";
التعريف والاستخدام
تحدد الخاصية lineHeight المسافة بين الأسطر في النص أو تعيدها.
دعم المتصفح
Property | |||||
---|---|---|---|---|---|
lineHeight | Yes | Yes | Yes | Yes | Yes |
بناء الجملة
إرجاع خاصية lineHeight:
object.style.lineHeight
قم بتعيين خاصية lineHeight:
object.style.lineHeight = "normal|number|length|%|initial|inherit"
قيم الملكية
Value | Description |
---|---|
normal | Normal line height is used. This is default |
number | A number that will be multiplied with the current font size to set the line height |
length | Defines the line height in length units |
% | Defines the line height in % of the current font size |
initial | Sets this property to its default value. Read about initial |
inherit | Inherits this property from its parent element. Read about inherit |
تفاصيل تقنية
القيمة الافتراضية: | عادي |
---|---|
قيمة الإرجاع: | سلسلة تمثل المسافة بين الأسطر في النص |
إصدار CSS | CSS1 |
مزيد من الأمثلة
مثال
قم بإرجاع ارتفاع خط عنصر <div>:
alert(document.getElementById("myDiv").style.lineHeight);
الصفحات ذات الصلة
دروس CSS: نص CSS
مرجع CSS: خاصية line-height
❮ نمط الكائن