CSS အမြင့် Property
ဥပမာ
<div> ဒြပ်စင်နှစ်ခု၏ အမြင့်ကို သတ်မှတ်ပါ-
div.a {
height: auto;
border:
1px solid black;
}
div.b {
height: 50px;
border: 1px solid black;
}
အောက်တွင် နောက်ထပ် "စမ်းသုံးကြည့်ပါ" ဥပမာများ။
အဓိပ္ပါယ်နှင့် အသုံးပြုမှု
ပိုင်ဆိုင်မှု သည် height
ဒြပ်စင်တစ်ခု၏ အမြင့်ကို သတ်မှတ်သည်။
ဒြပ်စင်တစ်ခု၏ အမြင့်သည် အကွက်များ၊ ဘောင်များ သို့မဟုတ် အနားသတ်များ မပါဝင်ပါ။
အကယ်၍ height: auto;
ဒြပ်စင်သည် ၎င်း၏အကြောင်းအရာကို မှန်ကန်စွာပြသနိုင်စေရန် ၎င်း၏အမြင့်ကို အလိုအလျောက်ချိန်ညှိမည်ဆိုပါက၊
အကယ်၍ height
ကိန်းဂဏာန်းတန်ဖိုး (pixels၊ (r)em၊ ရာခိုင်နှုန်းများကဲ့သို့) သတ်မှတ်ထားပါက၊ အကြောင်းအရာသည် သတ်မှတ်ထားသော အမြင့်အတွင်း မကိုက်ညီပါက၊ ၎င်းသည် ပြည့်လျှံသွားမည်ဖြစ်သည်။ ပြည့်လျှံနေသော အကြောင်းအရာကို ကွန်တိန်နာက မည်သို့ကိုင်တွယ်မည်ကို
ပြည့်လျှံ မှု ပိုင်ဆိုင်မှုက သတ်မှတ်သည်။
မှတ်ချက်- min -height နှင့်
max-height ဂုဏ်သတ္တိများသည် ပိုင်ဆိုင်မှုကို လွှမ်းမိုး
height
ထားသည်။
မူလတန်ဖိုး: | အော်တို |
---|---|
အမွေဆက်ခံသည်- | မဟုတ်ဘူး |
သက်ဝင်လှုပ်ရှားနိုင်သော | ဟုတ်တယ် ကာတွန်း အကြောင်းဖတ်ပါ။ |
ဗားရှင်း- | CSS1 |
JavaScript syntax- | အရာဝတ္ထု .style.height="500px" |
Browser ပံ့ပိုးမှု
ဇယားရှိ နံပါတ်များသည် ပိုင်ဆိုင်မှုကို အပြည့်အဝထောက်ခံသည့် ပထမဆုံးဘရောက်ဆာဗားရှင်းကို သတ်မှတ်ပေးသည်။
Property | |||||
---|---|---|---|---|---|
height | 1.0 | 4.0 | 1.0 | 1.0 | 7.0 |
CSS Syntax
height: auto|length|initial|inherit;
အိမ်ခြံမြေတန်ဖိုးများ
Value | Description | Play it |
---|---|---|
auto | The browser calculates the height. This is default | |
length | Defines the height in px, cm, etc. Read about length units | |
% | Defines the height in percent of the containing block | |
initial | Sets this property to its default value. Read about initial | |
inherit | Inherits this property from its parent element. Read about inherit |
နောက်ထပ် ဥပမာများ
ဥပမာ
ဒြပ်စင်တစ်ခု၏ အမြင့်ကို ပင်မဒြပ်စင်၏ အမြင့် 50% သို့ သတ်မှတ်ပါ-
#parent {
height: 100px;
}
#child {
height: 50%;
}
ဆက်စပ်စာမျက်နှာများ
CSS သင်ခန်းစာ- CSS အမြင့်နှင့် အနံ
CSS သင်ခန်းစာ- CSS Box မော်ဒယ်
CSS ရည်ညွှန်းချက်- အကျယ်ပိုင်ဆိုင်မှု
HTML DOM ရည်ညွှန်းချက်- အမြင့် ပိုင်ဆိုင်မှု