flex-wrap ဂုဏ်သတ္တိ

flex-wrap ဂုဏ်သတ္တိသည် ပင်မ ဝင်ရိုးတစ်လျှောက် ဘလောက်များကို စီစဉ်ခြင်းကို သတ်မှတ်ပေးသည်။ Flex ဘလောက်များ၏ မိဘအစိတ်အပိုင်းအတွက် အသုံးပြုသည်။ ဂုဏ်သတ္တိအတိုကောက် flex-flow ၏ အစိတ်အပိုင်းတစ်ခု ဖြစ်သည်။

သဒ္ဒါ

cssselector {
  flex-wrap: nowrap | wrap | wrap-reverse;
}

တန်ဖိုးများ

တန်ဖိုး ရှင်းလင်းချက်
nowrap တစ်ကြောင်းတည်းမုဒ် - ဘလောက်များကို တစ်ကြောင်းထဲတွင် စီစဉ်ထားသည်။
wrap ဘလောက်များကို တစ်ကြောင်းထဲတွင် မဆန့်ပါက ကြောင်းများစွာဖြင့် စီစဉ်ထားသည်။
wrap-reverse wrap နှင့် အတူတူပင်ဖြစ်သော်လည်း ဘလောက်များကို မတူညီသောအစီအစဉ်ဖြင့် စီစဉ်ထားသည် (ပထမ နောက်ဆုံးတစ်ခု၊ ထို့နောက် ပထမတစ်ခု)။

စံထားရှိသောတန်ဖိုး: nowrap.

ဥပမာ . wrap တန်ဖိုး

ယခု ဘလောက်များသည် ၎င်းတို့၏ထည့်ကွန်တိန်နာထဲတွင် မဆန့်နိုင်ပါ ထို့ကြောင့် ကြောင်းများစွာဖြင့် စီစဉ်သွားမည်:

html<div id="parent">
  <div>1</div>
  <div>2</div>
  <div>3</div>
  <div>4</div>
  <div>5</div>
  <div>6</div>
  <div>7</div>
  <div>8</div>
  <div>9</div>
</div>
css#parent {
  display: flex;
  flex-wrap: wrap;
  flex-direction: row;
  justify-content: space-between;
  border: 1px solid #696989;
  height: 200px;
  width: 330px;
  margin: auto;
}
#parent > div {
  width: 100px;
  height: 50px;
  border: 1px solid #696989;
}

Результат:

ဥပမာ . wrap-reverse တန်ဖိုး

ယခု အစီအစဉ်သည် ပြောင်းပြန်ဖြစ်သွားမည် (ဘလောက်များအတွင်းရှိ နံပါတ်များကို ကြည့်ပါ):

html<div id="parent">
  <div>1</div>
  <div>2</div>
  <div>3</div>
  <div>4</div>
  <div>5</div>
  <div>6</div>
  <div>7</div>
  <div>8</div>
  <div>9</div>
</div>
css#parent {
  display: flex;
  flex-wrap: wrap-reverse;
  flex-direction: row;
  justify-content: space-between;
  border: 1px solid #696989;
  height: 200px;
  width: 330px;
  margin: auto;
}
#parent > div {
  width: 100px;
  height: 50px;
  border: 1px solid #696989;
}

Результат:

ဥပမာ . nowrap တန်ဖိုး

ယခု ဘလောက်များကို တစ်ကြောင်းတည်းမုဒ်ဖြင့် နေရာချထားမည် (စံအတိုင်း)။ ဤတွင် width အတွက် တန်ဖိုးသည် ဘလောက်များအား မိဘထဲသို့ နေရာချရာတွင် အနှောင့်အယှက်ဖြစ်စေပါက လျစ်လျူရှုခံရမည်။ ဘလောက်များသည် မိဘထဲသို့ နေရာရသော်လည်း ၎င်းတို့၏ အမှန်တကယ်အကျယ်သည် 100px မဟုတ်ကြောင်း သတိပြုပါ၊ သတ်မှတ်ထားသည့်အတိုင်း၊ သို့သော် ပိုနည်းသည်:

html<div id="parent">
  <div>1</div>
  <div>2</div>
  <div>3</div>
  <div>4</div>
  <div>5</div>
  <div>6</div>
  <div>7</div>
  <div>8</div>
  <div>9</div>
</div>
css#parent {
  display: flex;
  flex-wrap: nowrap;
  flex-direction: row;
  justify-content: space-between;
  border: 1px solid #696989;
  height: 200px;
  width: 330px;
  margin: auto;
}
#parent > div {
  width: 100px;
  height: 50px;
  border: 1px solid #696989;
}

Результат:

ဥပမာ . nowrap တန်ဖိုး

သို့သော်၊ ဘလောက်များသည် ၎င်းတို့အတွက် သတ်မှတ်ထားသောအကျယ်ဖြင့် နေရာရပါက - width ဂုဏ်သတ္တိကို လျစ်လျူရှုမည်မဟုတ်ပါ။ ဘလောက်အရေအတွက်ကို လျှော့ချပြီး အားလုံးနေရာရအောင်လုပ်ကြည့်ရအောင်:

html<div id="parent">
  <div>1</div>
  <div>2</div>
  <div>3</div>
</div>
css#parent {
  display: flex;
  flex-wrap: nowrap;
  flex-direction: row;
  justify-content: space-between;
  border: 1px solid #696989;
  height: 200px;
  width: 330px;
  margin: auto;
}
#parent > div {
  width: 100px;
  height: 50px;
  border: 1px solid #696989;
}

Результат:

ဤသည်ကိုလည်း ကြည့်ပါ

  • flex-direction ဂုဏ်သတ္တိ,
    သည် flex ဘလောက်များ၏ ဝင်ရိုးဦးတည်ချက်ကို သတ်မှတ်ပေးသည်
  • justify-content ဂုဏ်သတ္တိ,
    သည် ပင်မ ဝင်ရိုးတစ်လျှောက် ညှိခြင်းကို သတ်မှတ်ပေးသည်
  • align-items ဂုဏ်သတ္တိ,
    သည် ဖြတ်ဝင်ရိုးတစ်လျှောက် ညှိခြင်းကို သတ်မှတ်ပေးသည်
  • flex-flow ဂုဏ်သတ္တိ,
    flex-direction နှင့် flex-wrap အတွက် အတိုကောက်
  • order ဂုဏ်သတ္တိ,
    သည် flex ဘလောက်များ၏ အစီအစဉ်ကို သတ်မှတ်ပေးသည်
  • align-self ဂုဏ်သတ္တိ,
    သည် ဘလောက်တစ်ခု၏ ညှိခြင်းကို သတ်မှတ်ပေးသည်
  • flex-basis ဂုဏ်သတ္တိ,
    သည် သီးခြား flex ဘလောက်တစ်ခု၏ အရွယ်အစားကို သတ်မှတ်ပေးသည်
  • flex-grow ဂုဏ်သတ္တိ,
    သည် flex ဘလောက်များ၏ လောဘကို သတ်မှတ်ပေးသည်
  • flex-shrink ဂုဏ်သတ္တိ,
    သည် flex ဘလောက်များ၏ ကျုံ့နိုင်စွမ်းကို သတ်မှတ်ပေးသည်
  • flex ဂုဏ်သတ္တိ,
    flex-grow, flex-shrink နှင့် flex-basis အတွက် အတိုကောက်