CSS grid-template ပိုင်ဆိုင်မှု
ဥပမာ
ပထမတန်းသည် 150px မြင့်သည့် ကော်လံသုံးခုကို ဇယားကွက်ပုံစံပြုလုပ်ပါ-
.grid-container {
display: grid;
grid-template: 150px
/ auto auto auto;
}
အဓိပ္ပါယ်နှင့် အသုံးပြုမှု
ပိုင်ဆိုင်မှုသည် အောက်ပါ grid-template
ဂုဏ်သတ္တိများအတွက် လက်တိုပိုင်ဆိုင်မှုတစ်ခုဖြစ်သည်-
မူလတန်ဖိုး: | none none none |
---|---|
အမွေဆက်ခံသည်- | မဟုတ်ဘူး |
သက်ဝင်လှုပ်ရှားနိုင်သော | ဟုတ်တယ် ကာတွန်း အကြောင်းဖတ်ပါ။ |
ဗားရှင်း- | CSS Grid Layout Module အဆင့် ၁ |
JavaScript syntax- | အရာဝတ္ထု .style.gridTemplate="250px / အော်တို အော်တို" |
Browser ပံ့ပိုးမှု
ဇယားရှိ နံပါတ်များသည် ပိုင်ဆိုင်မှုကို အပြည့်အဝထောက်ခံသည့် ပထမဆုံးဘရောက်ဆာဗားရှင်းကို သတ်မှတ်ပေးသည်။
Property | |||||
---|---|---|---|---|---|
grid-template | 57 | 16 | 52 | 10 | 44 |
CSS Syntax
grid-template: none|grid-template-rows /
grid-template-columns|grid-template-areas|initial|inherit;
အိမ်ခြံမြေတန်ဖိုးများ
Value | Description | Play it |
---|---|---|
none | Default value. No specific sizing of the columns or rows | |
grid-template rows / grid-template-columns | Specifies the size(s) of the columns and rows | |
grid-template-areas | Specifies the grid layout using named items | |
initial | Sets this property to its default value. Read about initial | |
inherit | Inherits this property from its parent element. Read about inherit |
နောက်ထပ် ဥပမာများ
ဥပမာ
"item1" သည် ပထမတန်းနှစ်တန်းရှိ ပထမကော်လံနှစ်ခုကို ဖြန့်ကြက်ထားသည့် အတန်းနှစ်တန်းကို သတ်မှတ်ပါ (ကော်လံငါးခုဇယားကွက်ပုံစံတွင်):
.item1 {
grid-area: myArea;
}
.grid-container {
display: grid;
grid-template:
'myArea myArea . . .'
'myArea myArea . . .';
}
ဥပမာ
ပစ္စည်းအားလုံးကို အမည်ပေးပြီး အဆင်သင့်သုံးနိုင်သော ဝဘ်စာမျက်နှာ နမူနာတစ်ခု ပြုလုပ်ပါ-
.item1 { grid-area: header; }
.item2 { grid-area:
menu; }
.item3 { grid-area:
main; }
.item4 { grid-area:
right; }
.item5 { grid-area:
footer; }
.grid-container {
display: grid;
grid-template:
'header header header header header header'
'menu main main main right right'
'menu footer footer
footer footer footer';
}
ဆက်စပ်စာမျက်နှာများ
CSS သင်ခန်းစာ- CSS Grid အကြောင်းအရာ
CSS ရည်ညွှန်းချက်- ဂရစ်-ဧရိယာ ပိုင်ဆိုင်မှု
CSS ရည်ညွှန်းချက်- grid-template-rows ပိုင်ဆိုင်မှု
CSS ရည်ညွှန်းချက်- grid-template-columns ပိုင်ဆိုင်မှု
CSS ရည်ညွှန်းချက်- grid-template-areas ပိုင်ဆိုင်မှု