CSS box-sizing Property
ဥပမာ
အစိတ်အပိုင်း၏ စုစုပေါင်း အကျယ်နှင့် အမြင့်တွင် အကွက်နှင့် ဘောင်ကို ထည့်သွင်းပါ-
#example1 {
box-sizing: border-box;
}
အောက်တွင် နောက်ထပ် "စမ်းသုံးကြည့်ပါ" ဥပမာများ။
အဓိပ္ပါယ်နှင့် အသုံးပြုမှု
box-sizing
ပိုင်ဆိုင်မှုသည် ဒြပ်စင်တစ်ခု၏ အကျယ်နှင့် အမြင့်ကို မည်ကဲ့သို့ တွက်ချက်သည်ကို သတ်မှတ်သည်- ၎င်းတို့တွင် padding နှင့် ဘောင်များ ပါဝင်သင့်သလား ၊
မူလတန်ဖိုး: | အကြောင်းအရာ-အကွက် |
---|---|
အမွေဆက်ခံသည်- | မဟုတ်ဘူး |
သက်ဝင်လှုပ်ရှားနိုင်သော | မဟုတ်ဘူး ကာတွန်း အကြောင်းဖတ်ပါ။ |
ဗားရှင်း- | CSS3 |
JavaScript syntax- | အရာဝတ္ထု .style.boxSizing="border-box" |
Browser ပံ့ပိုးမှု
ဇယားရှိ နံပါတ်များသည် ပိုင်ဆိုင်မှုကို အပြည့်အဝထောက်ခံသည့် ပထမဆုံးဘရောက်ဆာဗားရှင်းကို သတ်မှတ်ပေးသည်။
-webkit- သို့မဟုတ် -moz- ဖြင့်လိုက်သောနံပါတ်များကို ရှေ့ဆက်တွဲဖြင့်လုပ်ဆောင်သော ပထမဆုံးဗားရှင်းကို သတ်မှတ်ပါ။
Property | |||||
---|---|---|---|---|---|
box-sizing | 10.0 4.0 -webkit- |
8.0 | 29.0 2.0 -moz- |
5.1 3.2 -webkit- |
9.5 |
CSS Syntax
box-sizing: content-box|border-box|initial|inherit;
အိမ်ခြံမြေတန်ဖိုးများ
Value | Description |
---|---|
content-box | Default. The width and height properties (and min/max properties) includes only the content. Border and padding are not included |
border-box | The width and height properties (and min/max properties) includes content, padding and border |
initial | Sets this property to its default value. Read about initial |
inherit | Inherits this property from its parent element. Read about inherit |
နောက်ထပ် ဥပမာများ
ဥပမာ
ဘေးချင်းကပ်လျက် ဘောင်နှစ်ခုကို သတ်မှတ်ပါ-
div
{
box-sizing: border-box;
width: 50%;
border: 5px solid red;
float: left;
}
ဥပမာ
"universal box-sizing" ကို သတ်မှတ်ပါ-
* {
box-sizing: border-box;
}
ဆက်စပ်စာမျက်နှာများ
CSS သင်ခန်းစာ- CSS Box Sizing
HTML DOM ရည်ညွှန်းချက်- boxSizing ပိုင်ဆိုင်မှု