ပုံစံ maxWidth ပိုင်ဆိုင်မှု
ဥပမာ
<div> ဒြပ်စင်တစ်ခု၏ အမြင့်ဆုံးအကျယ်ကို သတ်မှတ်ပါ-
document.getElementById("myDiv").style.maxWidth = "100px";
အဓိပ္ပါယ်နှင့် အသုံးပြုမှု
maxWidth ပိုင်ဆိုင်မှုသည် ဒြပ်စင်တစ်ခု၏ အမြင့်ဆုံးအကျယ်ကို သတ်မှတ် သို့မဟုတ် ပြန်ပေးသည်။
maxWidth ပိုင်ဆိုင်မှုသည် ပိတ်ဆို့အဆင့်ဒြပ်စင်များ သို့မဟုတ် အကြွင်းမဲ့ သို့မဟုတ် ပုံသေအနေအထားရှိသော ဒြပ်စင်များပေါ်တွင်သာ သက်ရောက်မှုရှိသည်။
မှတ်ချက်- ဒြပ်စင်တစ်ခု၏ အကျယ်သည် maxWidth ပိုင်ဆိုင်မှုဖြင့် သတ်မှတ်ထားသော တန်ဖိုးထက် ဘယ်သောအခါမှ မကြီးနိုင်ပါ။
အကြံပြုချက်- ဒြပ်စင်တစ်ခု၏ အနည်းဆုံးအကျယ်ကို သတ်မှတ်ရန် သို့မဟုတ် ပြန်ပေးရန်၊ minWidth ပိုင်ဆိုင်မှုကို အသုံးပြုပါ။
Browser ပံ့ပိုးမှု
Property | |||||
---|---|---|---|---|---|
maxWidth | Yes | Yes | Yes | Yes | Yes |
အထားအသို
maxWidth ပိုင်ဆိုင်မှုကို ပြန်ပေးပါ။
object.style.maxWidth
maxWidth ပိုင်ဆိုင်မှုကို သတ်မှတ်ပါ-
object.style.maxWidth = "none|length|%|initial|inherit"
အိမ်ခြံမြေတန်ဖိုးများ
Value | Description |
---|---|
none | No limit on the width of the element. This is default |
length | Defines the maximum width in length units |
% | Defines the maximum width in % of the parent element |
initial | Sets this property to its default value. Read about initial |
inherit | Inherits this property from its parent element. Read about inherit |
နည်းပညာဆိုင်ရာအသေးစိတ်
မူလတန်ဖိုး: | မရှိ |
---|---|
ပြန်ပို့တန်ဖိုး- | ဒြပ်စင်တစ်ခု၏ အမြင့်ဆုံးအကျယ်ကို ကိုယ်စားပြုသော စာကြောင်းတစ်ခု |
CSS ဗားရှင်း | CSS2 |
နောက်ထပ် ဥပမာများ
ဥပမာ
<div> ဒြပ်စင်တစ်ခု၏ အမြင့်ဆုံးအကျယ်ကို ပြန်ပေးပါ။
alert(document.getElementById("myDiv").style.maxWidth);
ဆက်စပ်စာမျက်နှာများ
CSS သင်ခန်းစာ- CSS Dimension
CSS ရည်ညွှန်းချက်- အမြင့်ဆုံးအကျယ်ပိုင်ဆိုင်မှု
❮ စတိုင်အရာဝတ္ထု