Yeqela kokuqukethwe okuyinhloko Yeqela ku-docs navigation
Check
in English

Izitaki

Abasizi be-Shorthand bakhela phezu kwezinsiza zethu ze-flexbox ukwenza isakhiwo sengxenye sisheshe futhi sibe lula kunangaphambili.

Kuleli khasi

Izitaki zinikeza isinqamuleli sokusebenzisa izici ze-flexbox ukuze udale ngokushesha futhi kalula izakhiwo ku-Bootstrap. Yonke ikhredithi yomqondo nokusebenzisa iya kuphrojekthi yePylon yomthombo ovulekile .

Amakhanda phezulu! Ukusekelwa kwezinsiza ze-gap nge-flexbox kusanda kwengezwa ku-Safari, ngakho-ke cabanga ukuqinisekisa ukwesekwa kwesiphequluli osihlosile. Isakhiwo segridi akufanele sibe nezinkinga. Funda okwengeziwe .

Iqondile

Sebenzisa .vstackukuze udale izakhiwo eziqondile. Izinto ezistakiwe zinobubanzi obugcwele ngokuzenzakalelayo. Sebenzisa .gap-*izinsiza ukuze wengeze isikhala phakathi kwezinto.

Into yokuqala
Into yesibili
Into yesithathu
html
<div class="vstack gap-3">
  <div class="bg-light border">First item</div>
  <div class="bg-light border">Second item</div>
  <div class="bg-light border">Third item</div>
</div>

Evundlile

Sebenzisa .hstackkuzakhiwo ezivundlile. Izinto ezistakiwe ziphakathi nendawo ngokuzenzakalelayo futhi zithatha ububanzi bazo obudingekayo kuphela. Sebenzisa .gap-*izinsiza ukuze wengeze isikhala phakathi kwezinto.

Into yokuqala
Into yesibili
Into yesithathu
html
<div class="hstack gap-3">
  <div class="bg-light border">First item</div>
  <div class="bg-light border">Second item</div>
  <div class="bg-light border">Third item</div>
</div>

Ukusebenzisa izinsiza ze-margin enezingqimba .ms-autonjengama-spacers:

Into yokuqala
Into yesibili
Into yesithathu
html
<div class="hstack gap-3">
  <div class="bg-light border">First item</div>
  <div class="bg-light border ms-auto">Second item</div>
  <div class="bg-light border">Third item</div>
</div>

Futhi ngemithetho eqondile :

Into yokuqala
Into yesibili
Into yesithathu
html
<div class="hstack gap-3">
  <div class="bg-light border">First item</div>
  <div class="bg-light border ms-auto">Second item</div>
  <div class="vr"></div>
  <div class="bg-light border">Third item</div>
</div>

Izibonelo

Sebenzisa .vstackukuze ubeke izinkinobho nezinye izici:

html
<div class="vstack gap-2 col-md-5 mx-auto">
  <button type="button" class="btn btn-secondary">Save changes</button>
  <button type="button" class="btn btn-outline-secondary">Cancel</button>
</div>

Dala ifomu elisemgqeni nge .hstack:

html
<div class="hstack gap-3">
  <input class="form-control me-auto" type="text" placeholder="Add your item here..." aria-label="Add your item here...">
  <button type="button" class="btn btn-secondary">Submit</button>
  <div class="vr"></div>
  <button type="button" class="btn btn-outline-danger">Reset</button>
</div>

Sass

.hstack {
  display: flex;
  flex-direction: row;
  align-items: center;
  align-self: stretch;
}

.vstack {
  display: flex;
  flex: 1 1 auto;
  flex-direction: column;
  align-self: stretch;
}