Mawu Oyamba
Yambani ndi Bootstrap, chimango chodziwika kwambiri padziko lonse lapansi chomanga masamba omvera, oyambira mafoni, okhala ndi jsDelivr ndi tsamba loyambira ma template.
Mukuyang'ana kuwonjezera Bootstrap ku projekiti yanu? Gwiritsani ntchito jsDelivr, yoperekedwa kwaulere ndi anthu pa jsDelivr. Mukugwiritsa ntchito woyang'anira phukusi kapena mukufuna kutsitsa mafayilo oyambira? Pitani patsamba lotsitsa.
Matulani-mata sitayilo <link>
yanu <head>
pamaso pa masitayelo ena onse kuti mukweze CSS yathu.
Zambiri mwazinthu zathu zimafuna kugwiritsa ntchito JavaScript kuti igwire ntchito. Makamaka, amafuna jQuery , Popper.js , ndi mapulagini athu a JavaScript. Ikani zotsatirazi <script>
kumapeto kwa masamba anu, pomwe tagi yotseka isanakwane </body>
, kuti muwatsegule. jQuery iyenera kubwera poyamba, kenako Popper.js, ndiyeno mapulagini athu a JavaScript.
Timagwiritsa ntchito jQuery's slim build , koma mtundu wathunthu umathandizidwanso.
Mukufuna kudziwa kuti ndi zigawo ziti zomwe zimafuna jQuery, JS yathu, ndi Popper.js? Dinani ulalo wa zigawo zowonetsera pansipa. Ngati simukutsimikiza za kapangidwe ka tsamba, pitilizani kuwerenga mwachitsanzo template ya tsamba.
Yathu bootstrap.bundle.js
ndikuphatikiza Popperbootstrap.bundle.min.js
, koma osati jQuery . Kuti mumve zambiri za zomwe zikuphatikizidwa mu Bootstrap, chonde onani gawo lathu zomwe zili mkati .
Onetsani zigawo zomwe zikufunika JavaScript
- Zidziwitso zochotsa
- Mabatani osinthira maiko ndi ma checkbox/radio
- Carousel pamakhalidwe onse a slide, zowongolera, ndi zizindikiro
- Kugwa kuti musinthe mawonekedwe azinthu
- Zotsitsa kuti ziwonetsedwe ndi kuziyika (zimafunanso Popper.js )
- Makhalidwe owonetsera, kuika, ndi khalidwe la mpukutu
- Navbar kuti tikulitse pulogalamu yowonjezera yathu ya Collapse kuti tigwiritse ntchito machitidwe omvera
- Zida ndi popovers zowonetsera ndi kuziyika (zimafunanso Popper.js )
- Scrollspy pamachitidwe a mpukutu ndi zosintha zamayendedwe
Onetsetsani kuti masamba anu ali ndi mapangidwe aposachedwa ndi miyezo yachitukuko. Izi zikutanthauza kugwiritsa ntchito HTML5 doctype ndikuphatikiza meta tag yowonera pamachitidwe oyenera omvera. Ikani zonse pamodzi ndipo masamba anu aziwoneka motere:
Ndizo zonse zomwe mukufunikira pazofunikira zamasamba. Pitani ku zolemba za Layout kapena zitsanzo zathu zovomerezeka kuti muyambe kuyika zomwe zili patsamba lanu ndi zigawo zake.
Bootstrap imagwiritsa ntchito masitayelo ndi masitaelo ofunikira apadziko lonse lapansi omwe muyenera kudziwa mukamagwiritsa ntchito, zonse zomwe zimangoyang'anira kukhazikika kwa masitaelo a msakatuli. Tiyeni tilowe m'madzi.
Bootstrap imafuna kugwiritsa ntchito HTML5 doctype. Popanda izo, mudzawona masitayelo osangalatsa osakwanira, koma kuphatikiza sikuyenera kuyambitsa kudodometsa kulikonse.
Bootstrap imapangidwa mafoni choyamba , njira yomwe timakulitsa kachidindo kazida zam'manja kaye kenako ndikukulitsa zida ngati kuli kofunikira pogwiritsa ntchito mafunso a CSS media. Kuti muwonetsetse kumasulira koyenera ndi kukhudza kuyandikira kwa zida zonse, onjezani meta tag yoyankhira pa chipangizo chanu <head>
.
Mutha kuwona chitsanzo cha izi mukuchitapo kanthu poyambira template .
Kuti mumve zambiri zowongoka mu CSS, timasintha box-sizing
mtengo wapadziko lonse lapansi content-box
kupita ku border-box
. Izi zimawonetsetsa padding
kuti sizikhudza kukula komaliza kwa chinthu, koma zitha kuyambitsa zovuta ndi mapulogalamu ena ena monga Google Maps ndi Google Custom Search Engine.
Nthawi zina zomwe muyenera kuzichotsa, gwiritsani ntchito zinthu monga izi:
Ndi mawu omwe ali pamwambapa, zinthu zomwe zasungidwa - kuphatikiza zomwe zapangidwa kudzera - ::before
zonse ::after
zidzalandira zomwe box-sizing
zafotokozedwazo .selector-for-some-widget
.
Phunzirani zambiri za chitsanzo cha bokosi ndi kukula pa CSS Tricks .
Pakumasulira kopitilira muyeso, timagwiritsa ntchito Reboot kukonza zosagwirizana pa asakatuli ndi zida zonse kwinaku tikukhazikitsanso malingaliro ochulukirapo kuzinthu zodziwika bwino za HTML.
Khalani odziwa za kakulidwe ka Bootstrap ndikufikira anthu ammudzi ndi zinthu zothandizazi.
- Tsatirani @getbootstrap pa Twitter .
- Werengani ndikulembetsa ku The Official Bootstrap Blog .
- Chezani ndi a Bootstrappers anzanu ku IRC. Pa
irc.freenode.net
seva, mu##bootstrap
tchanelo. - Thandizo lokhazikitsa litha kupezeka pa Stack Overflow (tagged
bootstrap-4
). - Madivelopa akuyenera kugwiritsa ntchito mawu osakira
bootstrap
pamaphukusi omwe amasintha kapena kuwonjezera magwiridwe antchito a Bootstrap akamagawa kudzera mu npm kapena njira zofananira zotumizira kuti adziwike kwambiri.
Mutha kutsatiranso @getbootstrap pa Twitter pazamiseche zaposachedwa komanso makanema ochititsa chidwi anyimbo.