Isingeniso
Qalisa nge-Bootstrap, uhlaka oludume kakhulu emhlabeni lokwakha amasayithi asabelayo, amaselula okuqala, nge-jsDelivr kanye nekhasi lokuqala lesifanekiso.
Ingabe ufuna ukwengeza ngokushesha i-Bootstrap kuphrojekthi yakho? Sebenzisa i-jsDelivr, ehlinzekwe mahhala ngabantu bakwa-jsDelivr. Usebenzisa umphathi wephakheji noma udinga ukulanda amafayela omthombo? Yiya ekhasini lokulanda.
Kopisha-namathisela ishidi lesitayela <link>
ngaphambi <head>
kwawo wonke amanye amashidi esitayela ukuze ulayishe i-CSS yethu.
Izingxenye zethu eziningi zidinga ukusetshenziswa kwe-JavaScript ukuze zisebenze. Ngokukhethekile, zidinga i- jQuery , Popper.js , kanye nama-plugin ethu e-JavaScript. Beka okulandelayo <script>
ngasekugcineni kwamakhasi akho, ngaphambi nje </body>
kwethegi yokuvala, ukuze uwanike amandla. I-jQuery kufanele ize kuqala, bese i-Popper.js, bese kuba ama-plugin ethu e-JavaScript.
Sisebenzisa i -jQuery's slim build , kodwa inguqulo ephelele nayo iyasekelwa.
Ufuna ukwazi ukuthi yiziphi izingxenye ezidinga ngokusobala i-jQuery, i-JS yethu, ne-Popper.js? Chofoza isixhumanisi sezingxenye zombukiso ngezansi. Uma ungaqiniseki nhlobo mayelana nesakhiwo sekhasi elijwayelekile, qhubeka ufunda ukuze uthole isifanekiso sekhasi eliyisibonelo.
Bonisa izingxenye ezidinga i-JavaScript
- Izexwayiso zokucashisa
- Izinkinobho zokuguqula izimo nokusebenza kwebhokisi/umsakazo
- I-Carousel yakho konke ukuziphatha kwamaslayidi, izilawuli, nezinkomba
- Goqa ukuze uguqule ukubonakala kokuqukethwe
- Okwehliswayo kokuboniswa nokubeka (kudinga futhi i-Popper.js )
- Amamodeli okubonisa, ukuma, nokuziphatha kokuskrola
- Ibha ye-Navbar yokwelula i-plugin yethu Yokugoqa ukuze usebenzise indlela yokusabela
- Amathiphu wamathuluzi nama-popover okubonisa nokubeka (kudinga futhi i-Popper.js )
- I-Scrollspy ngokuziphatha kokuskrola nezibuyekezo zokuzulazula
Qiniseka ukuthi unamakhasi akho asethwe ngedizayini yakamuva nezindinganiso zokuthuthuka. Lokho kusho ukusebenzisa i-HTML5 doctype kanye nokufaka i-meta tag yembobo yokubuka ngokuziphatha okufanele kokuphendula. Kuhlanganise konke futhi amakhasi akho kufanele abukeke kanje:
Yilokho kuphela okudingayo kuzo zonke izidingo zekhasi. Vakashela amadokhumenti esakhiwo noma izibonelo zethu ezisemthethweni ukuze uqale ukubeka okuqukethwe kwesayithi lakho nezingxenye.
I-Bootstrap isebenzisa izitayela nezilungiselelo zomhlaba ezimbalwa ezibalulekile ozodinga ukuzazi lapho uyisebenzisa, zonke ezihloselwe ngokukhethekile ukwenziwa kwezitayela zesiphequluli esihlukile. Asicwilise phakathi.
I-Bootstrap idinga ukusetshenziswa kwe-HTML5 doctype. Ngaphandle kwaso, uzobona isitayela esingaphelele esijabulisayo, kodwa ukusihlanganisa akufanele kubangele noma yikuphi ukuphazamiseka okukhulu.
I-Bootstrap ithuthukiswa iselula kuqala , isu lapho sithuthukisa khona ikhodi yamadivayisi eselula kuqala bese sikhulisa izingxenye njengoba kudingeka sisebenzisa imibuzo yemidiya ye-CSS. Ukuze uqinisekise ukunikezwa okufanele nokusondeza kokuthinta kuwo wonke amadivayisi, engeza imetagi ye-viewport yokubuka ephendulayo ku- <head>
.
Ungabona isibonelo salokhu sisebenza kusifanekiso sokuqala .
Ukuze uthole ukulinganisa okuqondile okwengeziwe ku-CSS, sishintsha box-sizing
ivelu yomhlaba wonke ukusuka content-box
ku- border-box
. Lokhu kuqinisekisa padding
ukuthi akuthinti ububanzi bokugcina obubaliwe bento, kodwa kungabangela izinkinga ngesofthiwe yenkampani yangaphandle njenge-Google Amamephu kanye ne-Google Custom Search Engine.
Ezimweni ezingavamile lapho udinga ukuyibhala ngaphezulu, sebenzisa into efana nalena elandelayo:
Ngamazwibela angenhla, izakhi ezibekwe esidlekeni—okuhlanganisa nokuqukethwe okukhiqiziwe ::before
futhi ::after
—zonke zizodla ifa elishiwo box-sizing
lokho .selector-for-some-widget
.
Funda kabanzi mayelana nemodeli yebhokisi nokulinganisa ku-CSS Tricks .
Ngokunikezwa okuthuthukisiwe kwesiphequluli esiphambene, sisebenzisa u- Reboot ukuze ulungise ukungahambisani kuzo zonke iziphequluli namadivayisi kuyilapho sinikeza ukusetha kabusha okunemibono ethe xaxa ezintweni ezivamile ze-HTML.
Hlala unolwazi lwakamuva mayelana nokuthuthukiswa kwe-Bootstrap futhi ufinyelele umphakathi ngalezi zinsiza eziwusizo.
- Landela @getbootstrap ku-Twitter .
- Funda futhi ubhalisele Ibhulogi Ye-Bootstrap Esemthethweni .
- Xoxa nozakwethu be-Bootstrappers ku-IRC. Kuseva
irc.freenode.net
,##bootstrap
esiteshini. - Usizo lokuqalisa lungatholakala kokuthi Ukuchichima Kwesitaki (umakwe
bootstrap-4
). - Onjiniyela kufanele basebenzise igama elingukhiye
bootstrap
kumaphakheji ashintsha noma engeza ekusebenzeni kwe-Bootstrap lapho esabalalisa nge- npm noma izindlela zokulethwa ezifanayo ukuze kutholakale okuphezulu.
Ungakwazi futhi ukulandela u-@getbootstrap ku-Twitter ukuze uthole inhlebo yakamuva namavidiyo omculo amangalisayo.