Dubawa
Abubuwan da aka haɗa da zaɓuɓɓuka don ƙaddamar da aikin Bootstrap ɗinku, gami da kwantena nannade, tsarin grid mai ƙarfi, abu mai sassauƙa na kafofin watsa labarai, da azuzuwan masu amfani.
Kwantena
Kwantena sune mafi mahimmancin tsarin shimfidar wuri a cikin Bootstrap kuma ana buƙata lokacin amfani da tsarin grid ɗin mu na asali . Ana amfani da kwantena don ƙunshe, pad, da (wani lokaci) tsakiyar abun ciki a cikinsu. Yayin da kwantena na iya zama gida, yawancin shimfidu ba sa buƙatar akwati mai gida.
Bootstrap ya zo tare da kwantena daban-daban guda uku:
.container
, wanda ke saitamax-width
a kowane wuri mai amsawa.container-fluid
, wanda yakewidth: 100%
a duk wuraren karyawa.container-{breakpoint}
, wanda shinewidth: 100%
har zuwa lokacin da aka ƙayyade
Teburin da ke ƙasa yana kwatanta yadda kowane kwantena ya max-width
kwatanta da na asali .container
da kuma .container-fluid
cikin kowane wurin karya.
Duba su a aikace kuma kwatanta su a cikin misalin Grid ɗin mu .
Ƙarin ƙarami <576px |
Ƙananan ≥576px |
Matsakaici ≥768px |
Babban ≥992px |
Babban girma ≥1200px |
|
---|---|---|---|---|---|
.container |
100% | 540px ku | 720px ku | 960px ku | 1140px |
.container-sm |
100% | 540px ku | 720px ku | 960px ku | 1140px |
.container-md |
100% | 100% | 720px ku | 960px ku | 1140px |
.container-lg |
100% | 100% | 100% | 960px ku | 1140px |
.container-xl |
100% | 100% | 100% | 100% | 1140px |
.container-fluid |
100% | 100% | 100% | 100% | 100% |
Duk-in-daya
Ajin mu na yau da .container
kullun shine mai amsawa, kafaffen ganga mai faɗi, ma'ana max-width
canje-canjensa a kowane wurin hutu.
Ruwa
Yi amfani .container-fluid
da babban akwati mai faɗi, mai faɗi duka faɗin wurin kallo.
Mai amsawa
Sabbin kwantena masu amsawa a cikin Bootstrap v4.4. Suna ba ku damar tantance aji mai faɗin 100% har sai an kai ga ƙayyadadden wurin hutu, bayan haka muna amfani max-width
da s ga kowane mafi girman wuraren hutu. Misali, .container-sm
yana da faɗin 100% don farawa har sai sm
an isa wurin karya, inda zai haɓaka da md
, lg
, da xl
.
Matsaloli masu amsawa
Tun da an haɓaka Bootstrap don zama wayar hannu da farko, muna amfani da ɗimbin tambayoyin kafofin watsa labarai don ƙirƙirar wuraren hutu masu ma'ana don shimfidu da mu'amalarmu. Waɗannan wuraren hutu galibi sun dogara ne akan mafi ƙarancin faɗin kallo kuma suna ba mu damar haɓaka abubuwa yayin da kallon ke canzawa.
Bootstrap da farko yana amfani da jeri na neman kafofin watsa labarai masu zuwa-ko wuraren karyawa-a cikin fayilolin Sass tushen mu don shimfidar tsarin mu, tsarin grid, da abubuwan haɗin gwiwa.
Tunda mun rubuta tushen mu CSS a cikin Sass, duk tambayoyin kafofin watsa labarai suna samuwa ta hanyar Sass mixins:
Mukan yi amfani da tambayoyin kafofin watsa labarai lokaci-lokaci waɗanda ke tafiya ta wata hanya (girman allo da aka bayar ko ƙarami ):
Lura cewa tun da masu bincike ba su goyan bayan tambayoyin mahallin kewayo a halin yanzu , muna aiki a kusa da iyakoki min-
da max-
prefixes da kallon kallo tare da faɗuwar juzu'i (wanda zai iya faruwa a ƙarƙashin wasu yanayi akan manyan na'urorin dpi, alal misali) ta amfani da ƙima tare da daidaito mafi girma don waɗannan kwatancen. .
Har yanzu, waɗannan tambayoyin kafofin watsa labarai kuma ana samun su ta hanyar Sass mixins:
Hakanan akwai tambayoyin kafofin watsa labarai da masu haɗaka don yin niyya ga yanki ɗaya na girman allo ta amfani da mafi ƙanƙanta da matsakaicin faɗuwar maki.
Ana kuma samun waɗannan tambayoyin kafofin watsa labarai ta hanyar Sass mixins:
Hakazalika, tambayoyin kafofin watsa labarai na iya yin nisa da yawa:
Mixin Sass don yin niyya ga girman girman allo ɗaya zai kasance:
Z-index
Abubuwan abubuwan Bootstrap da yawa suna amfani da su z-index
, kayan CSS waɗanda ke taimakawa tsara shimfidar wuri ta samar da axis na uku don tsara abun ciki. Muna amfani da ma'aunin ma'aunin z-index na tsoho a cikin Bootstrap wanda aka ƙera don tsara kewayawa da kyau, tukwici na kayan aiki da popovers, modal, da ƙari.
Waɗannan maɗaukakin dabi'u suna farawa ne daga lamba ta sabani, babba kuma takamaiman isa don gujewa rikice-rikice. Muna buƙatar daidaitattun saitin waɗannan a duk faɗin kayan aikin mu - kayan aiki, popovers, navbars, dropdowns, modals — don haka za mu iya daidaita daidaitattun halaye. Babu wani dalili da ba za mu iya amfani da 100
+ ko 500
+ ba.
Ba mu ƙarfafa gyare-gyaren waɗannan dabi'u ɗaya; idan kun canza daya, kuna iya buƙatar canza su duka.
Don sarrafa iyakoki masu jere a cikin abubuwan da aka gyara (misali, maɓallai da bayanai a cikin ƙungiyoyin shigarwa), muna amfani da ƙananan ƙimar lambobi ɗaya z-index
na 1
, 2
, da 3
tsoho, shawagi, da jihohi masu aiki. A kan shawagi / mai da hankali / mai aiki, muna kawo wani yanki na musamman a gaba tare da ƙimar mafi girma z-index
don nuna iyakarsu akan abubuwan 'yan uwan.