Nkatsakanyo
Swiphemu na swihlawulekisi swo veka phurojeke ya wena ya Bootstrap, ku katsa na swikhomela-ndhawu swo phutsela, sisiteme ya matimba ya giridi, nchumu wa midiya lowu cinca-cincaka, na titlilasi ta vukorhokeri leti hlamulaka.
Swikhomela-ndhawu
Tikhontheyina i xiphemu xa xisekelo xa layout eka Bootstrap naswona swa laveka loko u tirhisa sisiteme ya hina ya gridi ya ntolovelo . Swibye swi tirhisiwa ku khoma, ku pad, na (minkarhi yin’wana) ku hlanganisa leswi nga endzeni ka swona. Hambi leswi swikhomela-ndhawu swi nga ha pfaleriwaka, swivumbeko swo tala a swi lavi xikhomela-ndhawu lexi pfanganisiweke.
Bootstrap yi ta na swibye swinharhu swo hambana:
.container
, leyi vekaka amax-width
eka ndhawu yin’wana ni yin’wana yo wisa leyi hlamulaka.container-fluid
, leyi ngawidth: 100%
eka tindhawu hinkwato to tshoveka.container-{breakpoint}
, ku nga kuwidth: 100%
fikela eka ndhawu leyi boxiweke yo tshoveka
Tafula leri nga laha hansi ri kombisa hilaha container yin’wana na yin’wana yi max-width
pimanisiwaka hakona na ya masungulo .container
na .container-fluid
ku tsemakanya breakpoint yin’wana na yin’wana.
Va vona va ri karhi va tirha u va pimanisa eka xikombiso xa hina xa Gridi .
Switsongo swinene < 576px |
Switsongo ≥576px |
Xikarhi xa ≥768px |
Lexikulu ≥992px |
Ku tlula mpimo ≥1200px |
|
---|---|---|---|---|---|
.container |
100% . | 540px | 720px hi ku | 960px | 1140px hi ndlela leyi |
.container-sm |
100% . | 540px | 720px hi ku | 960px | 1140px hi ndlela leyi |
.container-md |
100% . | 100% . | 720px hi ku | 960px | 1140px hi ndlela leyi |
.container-lg |
100% . | 100% . | 100% . | 960px | 1140px hi ndlela leyi |
.container-xl |
100% . | 100% . | 100% . | 100% . | 1140px hi ndlela leyi |
.container-fluid |
100% . | 100% . | 100% . | 100% . | 100% . |
Hinkwaswo-eka-xin’we
Tlilasi ya hina ya ntolovelo .container
i xikhomela-ndhawu lexi hlamulaka, xa ku anama loku nga cinciki, leswi vulaka ku max-width
cinca ka xona eka ndhawu yin’wana ni yin’wana yo tshoveka.
Xihalaki
Tirhisa .container-fluid
eka xigwitsirisi xa ku anama loku heleleke, lexi hlanganisaka ku anama hinkwako ka xivono.
Ku hlamula
Swikhomela-ndhawu leswi hlamulaka i swintshwa eka Bootstrap v4.4. Va ku pfumelela ku boxa tlilasi leyi nga 100% yo anama ku kondza ku fika ndhawu yo tsema leyi boxiweke, endzhaku ka sweswo hi tirhisa max-width
s eka yin’wana na yin’wana ya tindhawu to tsema ta le henhla. Xikombiso, .container-sm
yi anama hi 100% ku sungula ku kondza ku fika eka sm
breakpoint, laha yi nga ta ringanisa hi md
, lg
, na xl
.
Ku tshoveka loku hlamulaka
Tanihi leswi Bootstrap yi tumbuluxiweke ku va mobile ro sungula, hi tirhisa swivutiso swi nga ri swingani swa midiya ku tumbuluxa tindhawu to wisa leti twisisekaka eka swivumbeko swa hina na swihlanganisi. Swiphemu leswi swi seketeriwa ngopfu eka ku anama ka xivono xa le hansi naswona swi hi pfumelela ku ringanisa swiaki loko xivono xi cinca.
Bootstrap ngopfu-ngopfu yi tirhisa swiyenge leswi landzelaka swa swivutiso swa midiya—kumbe tindhawu to wisa—eka tifayela ta hina ta xihlovo xa Sass eka layout ya hina, sisiteme ya gridi, na swiphemu.
Leswi hi tsalaka CSS ya hina ya xihlovo eka Sass, swivutiso swa hina hinkwaswo swa vuhangalasi bya mahungu swi kumeka hi ku tirhisa ti mixins ta Sass:
Minkarhi yin’wana hi tirhisa swivutiso swa swihangalasamahungu leswi yaka eka tlhelo rin’wana (sayizi ya xikirini leyi nyikiweke kumbe leyitsongo ):
Xiya leswaku tanihileswi swihlamusela-marito sweswi swi nga seketeliki swivutiso swa xiyimo xa rhengu , hi tirha ku rhendzela swipimelo swa min-
na max-
swirhangi na swivono leswi nga na ku anama ka xiphemu (leswi nga humelelaka ehansi ka swiyimo swo karhi eka switirhisiwa swa dpi ya le henhla, hi xikombiso) hi ku tirhisa mimpimo leyi nga na vukheta bya le henhla eka ku pimanisiwa loku .
Nakambe, swivutiso leswi swa vuhangalasi bya mahungu swi tlhela swi kumeka hi ku tirhisa ti-Mixin ta Sass:
Ku tlhela ku va na swivutiso swa vuhangalasi bya mahungu na ti-mixin to kongomisa eka xiphemu xin’we xa vukulu bya xikirini hi ku tirhisa ku anama ka le hansi na lokukulu ka breakpoint.
Swivutiso leswi swa vuhangalasi bya mahungu swi tlhela swi kumeka hi ku tirhisa ti-Mixin ta Sass:
Hilaha ku fanaka, swivutiso swa midiya swi nga ha hlanganisa ku anama ko tala ka breakpoint:
Sass mixin yo kongomisa eka nxaxamelo wa sayizi ya xikirini leyi fanaka yi ta va:
Xikombo xa Z
Swiphemu swo hlayanyana swa Bootstrap swi tirhisa z-index
, nhundzu ya CSS leyi pfunaka ku lawula layout hi ku nyika axis ya vunharhu ku hlela nhundzu. Hi tirhisa xikalo xa z-index xa ntolovelo eka Bootstrap lexi endleriweke ku leya kahle ku famba-famba, switsundzuxo swa switirhisiwa na ti-popover, ti-modal, na swin’wana.
Mimpimo leyi ya le henhla yi sungula eka nhlayo ya ku tihlawulela, ya le henhla naswona yi kongomile ku ringana ku papalata ku lwisana hi ndlela leyinene. Hi lava sete ya ntolovelo ya leswi ku tsemakanya swiphemu swa hina leswi nga ni swiphemu—switsundzuxo swa switirhisiwa, ti-popover, ti-navbar, ti-dropdown, ti-modal—leswaku hi ta kota ku va lava nga cincekiki hi ndlela leyi twalaka eka mahanyelo. A ku na xivangelo xa leswaku a hi nga ta tirhisa 100
+ kumbe 500
+.
A hi khutazi ku cinca-cinca ka mimpimanyeto leyi ya munhu hi xiyexe; loko u fanele u cinca yin’we, swi nga ha endleka u fanele u ti cinca hinkwato.
Ku khoma mindzilakano leyi hlanganisaka endzeni ka swiphemu (xikombiso, swikomba-nkarhi na swingheniso eka mintlawa ya swingheniso), hi tirhisa z-index
mimpimo ya le hansi ya dijiti yin’we ya 1
, 2
, na ya swiyimo swa 3
xiviri, ku hover, na leswi tirhaka. Eka hover/focus/active, hi tisa elemente yo karhi emahlweni hi z-index
nkoka wa le henhla ku kombisa ndzilakano wa vona ehenhla ka swiaki swa vamakwavo.