Mwachidule
Zida ndi zosankha pakuyika pulojekiti yanu ya Bootstrap, kuphatikiza zotengera zokutira, makina amphamvu a gridi, chinthu chosinthika chapa media, ndi makalasi omvera.
Zotengera
Zotengera ndizomwe zimayambira kwambiri mu Bootstrap ndipo zimafunika mukamagwiritsa ntchito gridi yathu yosasinthika . Zotengera zimagwiritsidwa ntchito kukhala, pad, ndipo (nthawi zina) pakati zomwe zili mkati mwake. Ngakhale zotengera zimatha kukhala zisa, masanjidwe ambiri safuna chidebe chokhala ndi zisa.
Bootstrap imabwera ndi zotengera zitatu zosiyanasiyana:
.container
, yomwe imayikamax-width
pagawo lililonse lomvera.container-fluid
, zomwe zimakhalawidth: 100%
zosokoneza.container-{breakpoint}
, zomwe ziliwidth: 100%
mpaka kusweka kotchulidwa
Tebulo ili m'munsiyi ikuwonetsa momwe chidebe chilichonse max-width
chimafananira ndi choyambirira .container
komanso .container-fluid
pagawo lililonse loduka.
Awoneni akugwira ntchito ndikufanizira mu chitsanzo chathu cha Gridi .
Zocheperako < 576px |
Yaing'ono ≥576px |
Wapakatikati ≥768px |
Chachikulu ≥992px |
Chachikulu kwambiri ≥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% |
Zonse-mu-zimodzi
Gulu lathu losasinthika .container
ndi chidebe chomvera, chokhazikika, kutanthauza max-width
kusintha kwake pagawo lililonse.
Madzi
Gwiritsani .container-fluid
ntchito chidebe chokhala ndi m'lifupi mwake, kufalikira m'lifupi lonse la malo owonera.
Womvera
Zotengera zomvera ndi zatsopano mu Bootstrap v4.4. Amakulolani kuti mutchule kalasi yomwe ili ndi 100% yotambasula mpaka malo omwe mwatchulidwawo afika, pambuyo pake timayika max-width
s pa chigawo chilichonse chapamwamba. Mwachitsanzo, .container-sm
ndi 100% m'lifupi kuti ayambe mpaka pomwe sm
afika, pomwe adzakwera ndi md
, lg
, ndi xl
.
Kuyankha breakpoints
Popeza Bootstrap idapangidwa kuti ikhale yam'manja poyamba, timagwiritsa ntchito mafunso angapo azama TV kuti tipange zopumira zomveka pamasanjidwe athu ndi mawonekedwe athu. Malo opumirawa nthawi zambiri amatengera kukula kwa mawonekedwe ocheperako ndipo amatilola kuti tiwonjeze zinthu momwe mawonekedwe akusintha.
Bootstrap imagwiritsa ntchito mndandanda wamafunso otsatirawa - kapena ma breakpoints - m'mafayilo athu a Sass pamawonekedwe athu, grid system, ndi zida.
Popeza timalemba gwero lathu la CSS ku Sass, mafunso athu onse atolankhani akupezeka kudzera kusakaniza kwa Sass:
Nthawi zina timagwiritsa ntchito mafunso azama TV omwe amapita mbali ina (kukula kwa skrini kapena kucheperako ):
Zindikirani kuti popeza asakatuli sakuthandiza pano mafunso osiyanasiyana , timagwiritsa ntchito malire a ma min-
prefixes max-
ndi mawonedwe okhala ndi m'lifupi mwake (omwe amatha kuchitika pazida zamtundu wapamwamba wa dpi, mwachitsanzo) pogwiritsa ntchito milingo yolondola kwambiri poyerekezera izi. .
Apanso, mafunso awa atolankhani amapezekanso kudzera pa Sass mixin:
Palinso mafunso atolankhani ndi zosakaniza zolozera gawo limodzi la makulidwe a skrini pogwiritsa ntchito kutalika kocheperako komanso kopitilira muyeso.
Mafunso awa akupezekanso kudzera pa Sass mixins:
Momwemonso, mafunso azama media atha kufalikira m'magawo angapo:
Kuphatikizika kwa Sass poyang'ana mawonekedwe amtundu womwewo kungakhale:
Z - index
Zigawo zingapo za Bootstrap zimagwiritsa ntchito z-index
, katundu wa CSS womwe umathandizira kuwongolera masanjidwe popereka olamulira achitatu kuti akonze zomwe zili. Timagwiritsa ntchito sikelo yokhazikika ya z-index mu Bootstrap yomwe idapangidwa kuti ikhale yosanjikiza bwino, malangizo a zida ndi popovers, modal, ndi zina zambiri.
Miyezo yapamwambayi imayambira pa nambala yosawerengeka, yokwera komanso yachindunji kuti ipewe mikangano. Timafunikira seti yokhazikika ya izi pazigawo zathu zosanjikiza - zida, popovers, ma navbar, zotsikira, ma modals - kuti titha kukhala osasinthasintha pamakhalidwe. Palibe chifukwa chomwe sitinagwiritse ntchito 100
+ kapena 500
+.
Sitikulimbikitsa kuti muzikonda izi; mukasintha chimodzi, muyenera kusintha onse.
Kuti tithane ndi malire omwe akudutsana mkati mwa zigawo (monga mabatani ndi zolowetsa m'magulu olowetsa), timagwiritsa ntchito manambala otsika z-index
a 1
, 2
, ndi 3
makonda, hover, ndi makonda. Pa hover/focus/active, timabweretsa chinthu china kutsogolo chomwe chili ndi z-index
mtengo wapamwamba kuti chiwonetse malire awo pa zinthu za abale.