Isishwankathelo
Amacandelo kunye neenketho zokubeka iprojekthi yakho yeBootstrap, kubandakanya nezikhongozeli zokusonga, inkqubo yegridi enamandla, into yemidiya ebhetyebhetye, kunye neeklasi eziluncedo eziphendulayo.
Izikhongozeli
Izikhongozeli yeyona nto isisiseko uyilo kwiBootstrap kwaye iyafuneka xa usebenzisa inkqubo yethu yegridi engagqibekanga . Izikhongozeli zisetyenziselwa ukuqulatha, iphedi, kwaye (ngamanye amaxesha) iziko lomxholo ophakathi kwazo. Ngelixa izikhongozeli zinokubekwa kwindlwane, uninzi lwezakhiwo azifuni sikhongozeli esinendlwane.
I-Bootstrap iza nezikhongozeli ezintathu ezahlukeneyo:
.container
, emisela amax-width
kwindawo nganye yokusabela esabelayo.container-fluid
, ekuthiwidth: 100%
kuzo zonke iindawo zokuqhawuka.container-{breakpoint}
, elide libe yindawowidth: 100%
ekhankanyiweyo yokwaphuka
Itheyibhile engezantsi ibonisa ukuba isikhongozeli ngasinye sithelekiseka njani max-width
nesokuqala .container
nakwindawo .container-fluid
yoqhawulo nganye.
Zibone zisebenza kwaye uzithelekise kumzekelo wethu weGridi .
Incinci kakhulu <576px |
Incinci ≥576px |
Phakathi ≥768px |
Enkulu ≥992px |
Inkulu 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% |
Zonke kwenye
Udidi lwethu olungagqibekanga .container
sisikhongozeli esiphendulayo, esinobubanzi obusisigxina, okuthetha ukuba max-width
utshintsho lwaso kwindawo nganye yoqhawulo.
Ulwelo
Sebenzisa .container-fluid
kwisikhongozeli esibanzi esigcweleyo, esinaba bonke ububanzi bendawo yokujonga.
Ukusabela
Izikhongozeli eziphendulayo zintsha kwiBootstrap v4.4. Bakuvumela ukuba uchaze udidi oluyi-100% ububanzi de kufike indawo yokuqhawula ekhankanyiweyo, emva koko sisebenzise max-width
i-s kwi-breakpoints nganye ephezulu. Umzekelo, .container-sm
i-100% ububanzi ukuqala de kufike indawo sm
yokuphumla, apho iya kunyuka nge md
, lg
, kunye xl
.
Izaphulelo eziphendulayo
Kuba iBootstrap iphuhliswe ukuba ihambe kuqala, sisebenzisa imibuzo embalwa yemithombo yeendaba ukwenza iindawo zokuqhawula ezinengqondo zoyilo lwethu kunye nojongano. Ezi ndawo zokuqhawuka zisekwe ubukhulu becala kobubanzi obuncinci bendawo yokujonga kwaye zisivumela ukuba sinyuse umgangatho njengoko utshintsho lwemboniselo.
I-Bootstrap ikakhulu isebenzisa olu luhlu lulandelayo lwemibuzo yemidiya-okanye iindawo zokuqhawula-kwimithombo yethu yeefayile ze-Sass zoyilo lwethu, inkqubo yegridi, kunye nezixhobo.
Kuba sibhala umthombo wethu we-CSS e-Sass, yonke imibuzo yethu yeendaba iyafumaneka ngokuxutywa kwe-Sass:
Ngamanye amaxesha sisebenzisa imibuzo yemidiya eya kwelinye icala (ubungakanani obunikiweyo besikrini okanye encinci ):
Qaphela ukuba njengoko abakhangeli beencwadi okwangoku bengayixhasi imibuzo yomxholo woluhlu , sisebenza malunga nemida min-
kunye max-
nezimaphambili kunye neendawo zokujonga ezinobubanzi obuqhekekileyo (okwenzeka phantsi kweemeko ezithile kwizixhobo eziphezulu ze-dpi, umzekelo) ngokusebenzisa amaxabiso anochaneka oluphezulu kolu thelekiso. .
Kwakhona, le mibuzo yemidiya iyafumaneka ngokuxutywa kweSass:
Kukwakho imibuzo yemidiya kunye nemixube yokujolisa kwisegmenti enye yobukhulu besikrini usebenzisa ubuncinci kunye nobubanzi bendawo yokuqhawuka.
Le mibuzo yemidiya iyafumaneka ngokuxutywa kweSass:
Ngokufanayo, imibuzo yemithombo yeendaba inokufikelela kububanzi bendawo yokuphumla:
Umxube we-Sass wokujolisa kuluhlu lwesayizi yeskrini efanayo iya kuba:
Z-isalathisi
Amacandelo amaninzi eBootstrap asebenzisa z-index
, ipropati yeCSS enceda ukulawula uyilo ngokubonelela nge-axis yesithathu ukulungiselela umxholo. Sisebenzisa isikali sesalathiso sika-z esingagqibekanga kwiBootstrap eyilelwe ukuba ingamaleko ngokufanelekileyo, iingcebiso zesixhobo kunye neepopovers, iimodyuli, kunye nokunye.
La maxabiso aphezulu aqala kwinani elingenasizathu, eliphezulu kwaye lithe ngqo ngokwaneleyo ukuphepha iingxabano. Sifuna iseti esemgangathweni yazo zonke iinxalenye zethu ezineleyile-iingcebiso zezixhobo, iipopovers, ii-navbar, ukwehla, iimodyuli-ukuze sikwazi ukungaguquguquki kwindlela yokuziphatha. Akukho sizathu singakhange sisebenzise 100
+ okanye 500
+.
Asikukhuthazi ukwenza ezi nqobo zobuntu; ukuba utshintshe enye, kuya kufuneka utshintshe zonke.
Ukujongana nemida ethelelanayo ngaphakathi kwezixhobo (umzekelo, amaqhosha kunye negalelo kumaqela egalelo), sisebenzisa amanani asezantsi amadijithi omnye z-index
we 1
, 2
, kunye 3
nokungagqibekanga, i-hover, kunye neemeko ezisebenzayo. Kwi-hover/focus/esebenzayo, sizisa into ethile ngaphambili z-index
enexabiso eliphezulu ukubonisa umda wabo phezu kwezinto ezizalanayo.