Uhlolojikelele
Izingxenye nezinketho zokubeka iphrojekthi yakho ye-Bootstrap, okuhlanganisa iziqukathi zokugoqa, isistimu yegridi enamandla, into yemidiya eguquguqukayo, namakilasi ezinsiza eziphendulayo.
Izitsha
Iziqukathi ziyisici sesakhiwo esiyisisekelo ku-Bootstrap futhi siyadingeka uma kusetshenziswa uhlelo lwethu lwegridi oluzenzakalelayo . Iziqukathi zisetshenziselwa ukuqukatha, iphedi, futhi (ngezinye izikhathi) beka phakathi okuqukethwe ngaphakathi kwazo. Nakuba iziqukathi zingafakwa , izakhiwo eziningi azidingi isiqukathi esinesidleke.
I-Bootstrap iza neziqukathi ezintathu ezihlukene:
.container
, osetha u-amax-width
endaweni ngayinye esabelayo.container-fluid
, okungamawidth: 100%
-breakpoints.container-{breakpoint}
,width: 100%
okungaze kube indawo yokuphumula eshiwo
Ithebula elingezansi libonisa ukuthi isiqukathi ngasinye max-width
siqhathaniswa kanjani nesokuqala .container
kanye nakuyo .container-fluid
yonke indawo yokuhlukana.
Zibone zisebenza futhi uziqhathanise esibonelweni sethu seGridi .
Okuncane kakhulu < 576px |
Okuncane ≥576px |
Okumaphakathi ≥768px |
Okukhulu ≥992px |
Okukhulu kakhulu ≥1200px |
|
---|---|---|---|---|---|
.container |
100% | 540px | 720px | 960px | 1140px |
.container-sm |
100% | 540px | 720px | 960px | 1140px |
.container-md |
100% | 100% | 720px | 960px | 1140px |
.container-lg |
100% | 100% | 100% | 960px | 1140px |
.container-xl |
100% | 100% | 100% | 100% | 1140px |
.container-fluid |
100% | 100% | 100% | 100% | 100% |
Konke-kokukodwa
Isigaba sethu esizenzakalelayo siyisitsha esisabelayo, esinobubanzi obugxilile .container
, okusho max-width
izinguquko zaso endaweni ngayinye yokuphumula.
Uketshezi
Sebenzisa .container-fluid
isitsha esinobubanzi obugcwele, esihlanganisa bonke ububanzi bembobo yokubuka.
Iyasabela
Iziqukathi eziphendulayo zintsha ku-Bootstrap v4.4. Zikuvumela ukuthi ucacise ikilasi elibanzi ngo-100% kuze kube yilapho kufinyelelwa khona i-breakpoint, ngemva kwalokho sifaka max-width
u-s endaweni ngayinye ephakeme kakhulu. Isibonelo, .container-sm
ibanzi ngo-100% ukuze iqale kuze sm
kufinyelelwe indawo yokuphumula, lapho izokhuphuka ngo- md
, lg
, kanye xl
.
Ama-breakpoints asabelayo
Njengoba i-Bootstrap ithuthukiswe ukuthi ibe yiselula kuqala, sisebenzisa imibuzo embalwa yemidiya ukuze sakhe izindawo zokunqamuka ezinengqondo zezakhiwo zethu nezixhumi ezibonakalayo. Lawa maphoyinti okunqamuka kakhulu asekelwe kububanzi obuncane bembobo yokubuka futhi asivumela ukuba sikhulise izici njengoba imbobo yokubuka ishintsha.
I-Bootstrap ngokuyinhloko isebenzisa ububanzi bemibuzo yemidiya elandelayo—noma ama-breakpoint—kumafayela wethu we-Sass ongumthombo wesakhiwo sethu, isistimu yegridi, nezingxenye.
Njengoba sibhala umthombo wethu we-CSS kwa-Sass, yonke imibuzo yethu yemidiya itholakala ngamamiksi e-Sass:
Ngezinye izikhathi sisebenzisa imibuzo yemidiya eya ngakolunye uhlangothi (usayizi wesikrini onikeziwe noma omncane ):
Qaphela ukuthi njengoba iziphequluli okwamanje zingayisekeli imibuzo yokuqukethwe kobubanzi , sisebenza eduze kwemikhawulo min-
kanye max-
neziqalo nezinkundla zokubuka ezinobubanzi obuyingxenyana (okungenzeka ngaphansi kwezimo ezithile kumadivayisi e-dpi ephezulu, isibonelo) ngokusebenzisa amanani anembe kakhulu kulokhu kuqhathanisa. .
Nakulokhu futhi, le mibuzo yemidiya iyatholakala nangemiksi ye-Sass:
Kukhona nemibuzo yemidiya kanye nezingxube zokukhomba ingxenye eyodwa yamasayizi wesikrini kusetshenziswa ubuncane kanye nobubanzi be-breakpoint.
Le mibuzo yemidiya iyatholakala futhi nge-Sass mixins:
Ngokufanayo, imibuzo yemidiya ingase idlulele kububanzi be-breakpoint multiple:
Imiksi ye-Sass yokukhomba ububanzi bosayizi wesikrini obufanayo izoba:
Z-inkomba
Izingxenye ezimbalwa ze-Bootstrap zisebenzisa z-index
, isici se-CSS esiza ukulawula isakhiwo ngokunikeza i-eksisi yesithathu ukuhlela okuqukethwe. Sisebenzisa isikali esizenzakalelayo se-z-inkomba ku-Bootstrap esiklanyelwe ukusendlalela ngokufanele ukuzulazula, amathiphu wamathuluzi nama-popovers, amamodeli, nokuningi.
Lawa manani aphezulu aqala enombolweni engafanele, ephezulu futhi ecacile ngokwanele ukugwema ukungqubuzana. Sidinga isethi evamile yalokhu kuzo zonke izingxenye zethu ezinengqimba—amathuluzi, ama-popovers, ama-navbar, okwehliswayo, amamodeli—ukuze sikwazi ukungaguquguquki ngendlela enengqondo ekuziphatheni. Asikho isizathu sokuthi singasebenzisanga 100
+ noma 500
+.
Asikukhuthazi ukwenziwa ngendlela oyifisayo lawa manani angawodwana; uma ushintsha eyodwa, cishe udinga ukuwashintsha wonke.
Ukusingatha imingcele egqagqene ngaphakathi kwezingxenye (isb, izinkinobho nokokufaka emaqenjini okokufaka), sisebenzisa amanani aphansi edijithi eyodwa z-index
ethi 1
, 2
, kanye nezimo 3
ezizenzakalelayo, ezihamba phezulu, nezisebenzayo. Kokuhambisa phezulu/okugxilile/okusebenzayo, siletha into ethile phambili enevelu eliphezulu z-index
ukubonisa umngcele wayo phezu kwama-elementi ayizelamani.