စတိုင် ဖောင့် ပိုင်ဆိုင်မှု
ဥပမာ
အစိတ်အပိုင်းတစ်ခုအတွက် ဖောင့်ကို သတ်မှတ်ပါ-
document.getElementById("demo").style.font = "italic bold 20px arial,serif";
အဓိပ္ပါယ်နှင့် အသုံးပြုမှု
ဖောင့်ပိုင်ဆိုင်မှုသည် လက်တိုပုံစံဖြင့် သီးခြားဖောင့်ဂုဏ်သတ္တိ ခြောက်ခုအထိ သတ်မှတ်ပေးသည် သို့မဟုတ် ပြန်ပေးသည်။
ဤပိုင်ဆိုင်မှုဖြင့်၊ သင်သည် အောက်ပါတို့ကို သတ်မှတ်/ပြန်ယူနိုင်သည် (ဤအစီအစဥ်အတိုင်း)
- ဖောင့်စတိုင်
- ဖောင့်-မူကွဲ
- ဖောင့်အလေးချိန်
- ဖောင့်အရွယ်အစား
- မျဉ်းအမြင့်
- ဖောင့်-မိသားစု
ဖောင့်အရွယ်အစားနှင့် ဖောင့်မိသားစု လိုအပ်သည်။ အကယ်၍ အခြားတန်ဖိုးများထဲမှ တစ်ခု ပျောက်ဆုံးနေပါက၊ ပုံသေတန်ဖိုးများကို ထည့်သွင်းသွားပါမည်။
အထက်ဖော်ပြပါ ဂုဏ်သတ္တိများကို သီးခြားစတိုင်ဂုဏ်သတ္တိများဖြင့်လည်း သတ်မှတ်နိုင်ပါသည်။ ပိုမိုကောင်းမွန်သော ထိန်းချုပ်နိုင်စွမ်းရှိရန်အတွက် သီးခြားဂုဏ်သတ္တိများကို အသုံးပြုခြင်းသည် အဆင့်မြင့်မဟုတ်သော စာရေးဆရာများအတွက် အထူးအကြံပြုထားသည်။
Browser ပံ့ပိုးမှု
Property | |||||
---|---|---|---|---|---|
font | Yes | Yes | Yes | Yes | Yes |
အထားအသို
ဖောင့်ပိုင်ဆိုင်မှုကို ပြန်ပေးပါ-
object.style.font
ဖောင့်ပိုင်ဆိုင်မှုကို သတ်မှတ်ပါ-
object.style.font = "font-style font-variant font-weight font-size/line-height|caption|icon|menu|
message-box|small-caption|status-bar|initial|inherit;"
အိမ်ခြံမြေတန်ဖိုးများ
Value | Description |
---|---|
style | Sets the font-style |
variant | Sets the text in a small-caps font |
weight | Sets the boldness of the font |
size | Sets the size of the font |
lineHeight | Sets the distance between lines |
family | Sets the font face |
caption | The font used for captioned controls (like buttons, drop-downs, etc.) |
icon | The font used to label icons |
menu | The font used in menus |
message-box | The font used in dialog boxes |
small-caption | The font used in small controls |
status-bar | The font used in window status bars |
initial | Sets this property to its default value. Read about initial |
inherit | Inherits this property from its parent element. Read about inherit |
နည်းပညာဆိုင်ရာအသေးစိတ်
မူလတန်ဖိုး: | မသတ်မှတ်ထားပါ |
---|---|
ပြန်ပို့တန်ဖိုး- | ဒြပ်စင်၏ မတူညီသော ဖောင့်ဂုဏ်သတ္တိများကို ကိုယ်စားပြုသော စာကြောင်းတစ်ခု |
CSS ဗားရှင်း | CSS1 |
နောက်ထပ် ဥပမာများ
ဥပမာ
အစိတ်အပိုင်းတစ်ခု၏ ဖောင့်ကို ပြန်ပေးပါ။
alert(document.getElementById("demo").style.font);
ဆက်စပ်စာမျက်နှာများ
CSS သင်ခန်းစာ- CSS ဖောင့်
CSS ရည်ညွှန်းချက်- ဖောင့်ပိုင်ဆိုင်မှု
❮ စတိုင်အရာဝတ္ထု