grid shorthand
W3C CSS Snapshot 2026
Explicit grid သို့မဟုတ် implicit grid ကို တစ်ကြောင်းတည်း သတ်မှတ်ပါတယ်။ မရေးခဲ့တဲ့ template နဲ့ auto-placement property တွေကို မူလတန်ဖိုး ပြန်ထားပါတယ်။
Code စမ်းလို့ရတဲ့ သင်ခန်းစာ ဖွင့်ရန်
ဒီစာမျက်နှာမှာ
ရေးပုံနဲ့ သုံးလို့ရတဲ့ တန်ဖိုးများ
| တန်ဖိုး သို့မဟုတ် ရေးပုံ | အလုပ်လုပ်ပုံ |
|---|---|
none | Grid template နဲ့ implicit သတ်မှတ်ချက်တွေကို မူလအတိုင်း ပြန်ထားပါတယ်။ |
40px 70px / 1fr 2fr | grid-template လို explicit row နဲ့ column သတ်မှတ်ပါတယ်။ |
auto-flow 60px / 1fr 1fr | Explicit column နှစ်ခုနဲ့ row လိုက်ဖြည့်ပါတယ်။ ထပ်ပေါ်တဲ့ row တွေက 60px မြင့်ပါတယ်။ |
60px 60px / auto-flow 80px | Explicit row နှစ်ခုနဲ့ column လိုက်ဖြည့်ပါတယ်။ ထပ်ပေါ်တဲ့ column အကျယ်က 80px ပါ။ |
နမူနာကို စမ်းကြည့်ပါ
<!doctype html>
<html lang="en">
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<title>grid example</title>
<style>
.layout { display: grid; width: min(100%, 320px); border: 2px solid teal; box-sizing: border-box; }
.layout > div { padding: 8px 12px; background: #def5f5; color: #123; border: 1px solid #81b9b5; box-sizing: border-box; }
.layout { grid: auto-flow 60px / 1fr 1fr; }
</style>
</head>
<body>
<div class="layout">
<div class="first">A</div>
<div class="second">B</div>
<div>C</div>
</div>
</body>
</html>
စမ်းကြည့်ရင် ဘာဖြစ်မလဲ Column နှစ်ခုရှိပြီး ထပ်ပေါ်လာတဲ့ row တစ်ခုစီက 60px မြင့်ပါတယ်။