Incamake
Ibigize hamwe nuburyo bwo gushiraho umushinga wawe wa Bootstrap, harimo gupfunyika ibikoresho, sisitemu ikomeye ya gride, ikintu cyitangazamakuru cyoroshye, hamwe nibyiciro byingirakamaro.
Ibikoresho
Ibirimwo nibintu byibanze byimiterere muri Bootstrap kandi birasabwa mugihe ukoresheje sisitemu ya gride idasanzwe . Ibikoresho bikoreshwa mukubamo, padi, na (rimwe na rimwe) hagati yibirimo. Mugihe kontineri ishobora guterwa, imiterere myinshi ntisaba icyombo.
Bootstrap izanye ibintu bitatu bitandukanye:
.container
, ishyiraho amax-width
kuri buri cyerekezo gisubiza.container-fluid
, niwidth: 100%
Kuri Byose.container-{breakpoint}
, niwidth: 100%
kugeza igihe cyerekanwe
Imbonerahamwe ikurikira irerekana uburyo buri kontineri max-width
igereranya numwimerere .container
ndetse .container-fluid
no kuri buri gice.
Reba mubikorwa kandi ubigereranye murugero rwacu .
Gitoya <576px |
Gitoya ≥576px |
Hagati ≥768px |
Kinini ≥992px |
Kinini kinini ≥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% |
Byose hamwe
Icyiciro cyacu cyambere .container
ni igisubizo, cyagutse-cyagutse, bivuze max-width
impinduka zacyo kuri buri gice.
Amazi
Koresha .container-fluid
ubugari bwuzuye kontineri, uzenguruke ubugari bwose bwo kureba.
Igisubizo
Ibikoresho byabashubije ni bishya muri Bootstrap v4.4. Bakwemerera kwerekana icyiciro gifite ubugari 100% kugeza igihe cyerekanwe kigeze, nyuma yo gusaba max-width
s kuri buri cyiciro cyo hejuru. Kurugero, .container-sm
ni 100% ubugari kugirango utangire kugeza aho ibice sm
bigeze, aho bizapima hamwe md
, lg
na xl
.
Inzira zishubije
Kubera ko Bootstrap yatejwe imbere kugirango igendanwa mbere, dukoresha urutonde rwibibazo byinshi byitangazamakuru kugirango dushyireho ibintu byumvikana kumiterere yacu. Ibice byacitse ahanini bishingiye kubugari buke bwo kureba no kutwemerera gupima ibintu nkuko bigaragara bihinduka.
Bootstrap ikoresha cyane cyane itangazamakuru ryibibazo bikurikira - cyangwa aho bihurira - mumasoko yacu ya Sass dosiye kumiterere yacu, sisitemu ya gride, nibigize.
Kuva twandika isoko yacu CSS muri Sass, ibibazo byitangazamakuru byacu byose biraboneka binyuze muri Sass ivanze:
Rimwe na rimwe dukoresha ibibazo by'itangazamakuru bijya mu kindi cyerekezo (ingano ya ecran yatanzwe cyangwa ntoya ):
Menya ko kuva mushakisha zidashyigikiye urutonde rwibibazo , dukora hafi yimbibi za prefixes min-
hamwemax-
na kureba hamwe nubugari bwibice (bishobora kugaragara mubihe bimwe na bimwe kubikoresho byo hejuru-dpi, urugero) dukoresheje indangagaciro zifite ubusobanuro bunoze bwo kugereranya. .
Na none kandi, ibyo bibazo byitangazamakuru nabyo biraboneka binyuze muri Sass ivanze:
Hariho kandi ibibazo byitangazamakuru hamwe nuruvange rwo kwerekana igice kimwe cyubunini bwa ecran ukoresheje ubugari ntarengwa kandi ntarengwa.
Ibi bibazo byitangazamakuru biraboneka kandi binyuze muri Sass ivanze:
Mu buryo nk'ubwo, ibibazo by'itangazamakuru bishobora kumara ubugari butandukanye:
Sass ivanga kugirango igere ku ntera ingana ya ecran yaba:
Z-indangagaciro
Ibice byinshi bya Bootstrap ikoresha z-index
, umutungo wa CSS ufasha kugenzura imiterere utanga umurongo wa gatatu kugirango utegure ibirimo. Twifashishije igipimo gisanzwe cya z-indangagaciro muri Bootstrap yagenewe gukora neza kugendagenda neza, ibikoresho hamwe na popovers, modal, nibindi byinshi.
Indangagaciro zo hejuru zitangirira ku mubare utabishaka, muremure kandi wihariye bihagije kugirango wirinde amakimbirane. Dukeneye urutonde rusanzwe rwibi bice byacu - ibikoresho, popovers, navbars, ibitonyanga, modal - kuburyo dushobora guhuza ibitekerezo muburyo bwiza. Ntampamvu tutashoboraga gukoresha 100
+ cyangwa 500
+.
Ntabwo dushishikarizwa kwihitiramo indangagaciro z'umuntu ku giti cye; ugomba guhindura imwe, birashoboka ko ugomba guhindura byose.
Kugirango ukemure imipaka irenze ibice (urugero, buto ninjiza mumatsinda yinjiza), dukoresha imibare mike yimibare z-index
ya 1
,, 2
na 3
kubisanzwe, kuzenguruka, na leta zikora. Kuri hover / kwibanda / gukora, tuzana ikintu runaka kumwanya wambere hamwe z-index
nagaciro keza kugirango twerekane imipaka yabo kubintu bavukana.