نمط fontSizeAdjust الملكية
مثال
ضبط حجم الخط:
document.getElementById("demo").style.fontSizeAdjust = "0.58";
التعريف والاستخدام
تقوم الخاصية fontSizeAdjust بتعيين أو إرجاع قيمة جانب الخط للنص.
كل الخطوط لها قيمة أبعاد وهي فرق الحجم بين الحرف الصغير "x" والحرف الكبير "X".
تمنحك الخاصية fontSizeAdjust تحكمًا أفضل في حجم الخط عندما لا يتوفر خط الاختيار الأول. عندما لا يكون الخط متاحًا ، يستخدم المستعرض الخط الثاني المحدد. قد يؤدي هذا إلى تغيير كبير في حجم الخط. لمنع هذا ، استخدم هذه الخاصية.
عندما يعرف المستعرض قيمة العرض إلى الارتفاع لخط الاختيار الأول ، يمكن للمتصفح معرفة حجم الخط الذي يجب استخدامه عند عرض النص بخط الاختيار الثاني.
دعم المتصفح
Property | |||||
---|---|---|---|---|---|
fontSizeAdjust | Not supported | Not supported | Yes | Not supported | Not supported |
بناء الجملة
قم بإرجاع خاصية fontSizeAdjust:
object.style.fontSizeAdjust
قم بتعيين الخاصية fontSizeAdjust:
object.style.fontSizeAdjust = "none|number|initial|inherit"
Value | Description |
---|---|
none | Default value. No font size adjustment |
number | Preserve the first-choice font's x-height, and calculate the aspect value ratio for the font. The formula that is used: font-size of first-choice font*(aspect value of first-choice font/aspect value of available font)=font-size to use on available font Example: If 14px Verdana (aspect value of 0.58) was unavailable, but the available font, Times New Roman, has an aspect value of 0.46, the adjusted font-size to use would be 14*(0.58/0.46) = 17.65px. |
initial | Sets this property to its default value. Read about initial |
inherit | Inherits this property from its parent element. Read about inherit |
تفاصيل تقنية
القيمة الافتراضية: | لا أحد |
---|---|
قيمة الإرجاع: | سلسلة ، تمثل قيمة جانب الخط لنص |
إصدار CSS | CSS3 |
الصفحات ذات الصلة
برنامج CSS التعليمي: CSS Font
مرجع CSS: خاصية حجم الخط
مرجع HTML DOM: خاصية الخط
❮ نمط الكائن