ပုံစံ fontStyle Property
ဥပမာ
ဒြပ်စင်တစ်ခုအတွက် ဖောင့်ကို "italic" ဟု သတ်မှတ်ပါ-
document.getElementById("demo").style.fontStyle = "italic";
အဓိပ္ပါယ်နှင့် အသုံးပြုမှု
fontStyle ပိုင်ဆိုင်မှုသည် ဖောင့်စတိုင်ကို ပုံမှန်ဖြစ်စေ၊ စာလုံးစောင်းဖြစ်စေ သို့မဟုတ် မျဉ်းစောင်းဖြစ်စေဖြစ်စေ သတ်မှတ်ပေးသည် သို့မဟုတ် ပြန်ပေးသည်။
Browser ပံ့ပိုးမှု
Property | |||||
---|---|---|---|---|---|
fontStyle | Yes | Yes | Yes | Yes | Yes |
အထားအသို
fontStyle ပိုင်ဆိုင်မှုကို ပြန်ပေးပါ။
object.style.fontStyle
fontStyle ပိုင်ဆိုင်မှုကို သတ်မှတ်ပါ-
object.style.fontStyle = "normal|italic|oblique|initial|inherit"
အိမ်ခြံမြေတန်ဖိုးများ
Value | Description |
---|---|
normal | Font is normal. This is default |
italic | Font is in italic |
oblique | Font is in oblique |
initial | Sets this property to its default value. Read about initial |
inherit | Inherits this property from its parent element. Read about inherit |
နည်းပညာဆိုင်ရာအသေးစိတ်
မူလတန်ဖိုး: | ပုံမှန် |
---|---|
ပြန်ပို့တန်ဖိုး- | Element ရှိ စာသား၏ ဖောင့်ပုံစံကို ကိုယ်စားပြုသော စာတန်း |
CSS ဗားရှင်း | CSS1 |
နောက်ထပ် ဥပမာများ
ဥပမာ
ဖြစ်နိုင်ချေတန်ဖိုးများကို သရုပ်ပြခြင်း-
var listValue = selectTag.options[selectTag.selectedIndex].text;
document.getElementById("demo").style.fontStyle = listValue;
ဥပမာ
ဒြပ်စင်တစ်ခု၏ ဖောင့်စတိုင်ကို ပြန်ပေးပါ။
alert(document.getElementById("demo").style.fontStyle);
ဆက်စပ်စာမျက်နှာများ
CSS သင်ခန်းစာ- CSS ဖောင့်
CSS ရည်ညွှန်းချက်- ဖောင့်ပုံစံ ပိုင်ဆိုင်မှု
HTML DOM ရည်ညွှန်းချက်- ဖောင့်ပိုင်ဆိုင်မှု
❮ စတိုင်အရာဝတ္ထု