ပုံစံ fontWeight Property
ဥပမာ
ဒြပ်စင်တစ်ခုအတွက် ဖောင့်အလေးချိန်ကို "900" ဟု သတ်မှတ်ပါ-
document.getElementById("demo").style.fontWeight = "900";
အဓိပ္ပါယ်နှင့် အသုံးပြုမှု
fontWeight ပိုင်ဆိုင်မှုသည် စာသားတစ်ခုရှိ စာလုံးအထူ သို့မဟုတ် ပါးမည်မျှပြသသင့်သည်တို့ကို သတ်မှတ် သို့မဟုတ် ပြန်ပေးသည်။
Browser ပံ့ပိုးမှု
Property | |||||
---|---|---|---|---|---|
fontWeight | Yes | Yes | Yes | Yes | Yes |
အထားအသို
fontWeight ပိုင်ဆိုင်မှုကို ပြန်ပေးပါ။
object.style.fontWeight
fontWeight ကို သတ်မှတ်ပါ-
object.style.fontWeight = "normal|lighter|bold|bolder|value|initial|inherit"
အိမ်ခြံမြေတန်ဖိုးများ
Value | Description |
---|---|
normal | Font is normal. This is default |
lighter | Font is lighter |
bold | Font is bold |
bolder | Font is bolder |
100 200 300 400 500 600 700 800 900 |
Defines from light to bold 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 ဗားရှင်း | CSS1 |
နောက်ထပ် ဥပမာများ
ဥပမာ
ဖြစ်နိုင်ချေတန်ဖိုးများကို သရုပ်ပြခြင်း-
var listValue = selectTag.options[selectTag.selectedIndex].text;
document.getElementById("demo").style.fontWeight = listValue;
ဥပမာ
အစိတ်အပိုင်းတစ်ခု၏ ဖောင့်အလေးချိန်ကို ပြန်ပေးပါ။
alert(document.getElementById("demo").style.fontWeight);
ဆက်စပ်စာမျက်နှာများ
CSS သင်ခန်းစာ- CSS ဖောင့်
CSS ရည်ညွှန်းချက်- ဖောင့်အလေးချိန် ပိုင်ဆိုင်မှု
HTML DOM ရည်ညွှန်းချက်- ဖောင့်ပိုင်ဆိုင်မှု
❮ စတိုင်အရာဝတ္ထု