Isikhundla
Sebenzisa laba basizi ukuze ulungiselele ngokushesha indawo yento.
Ingaphezulu elilungisiwe
Misa i-elementi phezulu kwembobo yokubuka, ukusuka onqenqemeni ukuya onqenqemeni. Qiniseka ukuthi uyakuqonda ukubaluleka kwesimo esigxilile kuphrojekthi yakho; ungase udinge ukwengeza i-CSS eyengeziwe.
<div class="fixed-top">...</div>
Kulungiswe phansi
Misa i-elementi ezansi kwembobo yokubuka, ukusuka onqenqemeni ukuya onqenqemeni. Qiniseka ukuthi uyakuqonda ukubaluleka kwesimo esigxilile kuphrojekthi yakho; ungase udinge ukwengeza i-CSS eyengeziwe.
<div class="fixed-bottom">...</div>
Okunamathelayo phezulu
Misa i-elementi phezulu kwembobo yokubuka, ukusuka onqenqemeni ukuya onqenqemeni, kodwa kuphela ngemva kokuthi uskrole udlule kuyo. Insiza .sticky-top
isebenzisa i-CSS's position: sticky
, engasekelwe ngokugcwele kuzo zonke iziphequluli.
<div class="sticky-top">...</div>
Ingaphezulu elinamathelayo elisabelayo
Ukuhlukahluka okusabelayo kukhona futhi .sticky-top
kosizo.
<div class="sticky-sm-top">Stick to the top on viewports sized SM (small) or wider</div>
<div class="sticky-md-top">Stick to the top on viewports sized MD (medium) or wider</div>
<div class="sticky-lg-top">Stick to the top on viewports sized LG (large) or wider</div>
<div class="sticky-xl-top">Stick to the top on viewports sized XL (extra-large) or wider</div>