خاصية وزن الخط في CSS
مثال
قم بتعيين وزن خط مختلف لثلاث فقرات:
p.normal {
font-weight: normal;
}
p.thick {
font-weight: bold;
}
p.thicker {
font-weight: 900;
}
التعريف والاستخدام
font-weight
تحدد الخاصية كيفية عرض الأحرف السميكة أو الرفيعة في النص .
القيمة الافتراضية: | عادي |
---|---|
وارث: | نعم |
متحرك: | نعم. اقرأ عن animatable |
الإصدار: | CSS1 |
بناء جملة JavaScript: | الكائن .style.fontWeight = "غامق" |
دعم المتصفح
تحدد الأرقام الواردة في الجدول إصدار المتصفح الأول الذي يدعم الخاصية بالكامل.
Property | |||||
---|---|---|---|---|---|
font-weight | 2.0 | 4.0 | 1.0 | 1.3 | 3.5 |
بنية CSS
font-weight: normal|bold|bolder|lighter|number|initial|inherit;
قيم الملكية
Value | Description | Play it |
---|---|---|
normal | Defines normal characters. This is default | |
bold | Defines thick characters | |
bolder | Defines thicker characters | |
lighter | Defines lighter characters | |
100 200 300 400 500 600 700 800 900 |
Defines from thin to thick characters. 400 is the same as normal, and 700 is the same as bold | |
initial | Sets this property to its default value. Read about initial | |
inherit | Inherits this property from its parent element. Read about inherit |
الصفحات ذات الصلة
برنامج CSS التعليمي: CSS Font
مرجع CSS: خاصية الخط
مرجع DOM HTML: خاصية fontWeight