Ɔvaviu fɔ di Baybul
Komponent ɛn opshɔn fɔ layt ɔut yu Bootstrap projɛkt, inklud wrap kɔntena dɛn, wan pawaful grid sistem, wan fleksibul midia ɔbjɛkt, ɛn rispɔnsiv yutiliti klas dɛn.
Kɔntinɛnt dɛn
Kɔntinɛnt na di mɔs besik layout ɛlimɛnt na Bootstrap ɛn dɛn nid dɛn we yu de yuz wi difɔlt grid sistem . Dɛn kin yuz kɔntena fɔ kɔntinyu, pad, ɛn (sɔntɛnde) sɛnt di tin dɛn we de insay dɛn. Pan ɔl we dɛn kin nest kɔntena dɛn, bɔku pan di layout dɛn nɔ nid kɔntena we dɛn nest.
Bootstrap kam wit tri difrɛn kɔntena dɛn:
.container
, we de sɛt amax-width
na ɛni rispɔnsiv brekpɔynt.container-fluid
, wewidth: 100%
na ɔl di say dɛn we dɛn kin brok.container-{breakpoint}
, we nawidth: 100%
te di brekpoint we dɛn dɔn tɔk bɔt
Di tebul we de dɔŋ ya de sho aw ɛni kɔntena in dɛn max-width
kɔmpia to di fɔs wan .container
ɛn .container-fluid
akɔdin to ɛni brek pɔynt.
Si dɛn insay akshɔn ɛn kɔmpia dɛn na wi Grid ɛgzampul .
Ekstra smɔl <576px |
Smɔl ≥576px |
Midul ≥768px fɔ di wan dɛn we de |
Big big ≥992px |
Ekstra big ≥1200px |
|
---|---|---|---|---|---|
.container |
100% na di . | 540px na di pikchɔ | 720px na di pikchɔ | 960px na di pikchɔ | 1140px na di pikchɔ |
.container-sm |
100% na di . | 540px na di pikchɔ | 720px na di pikchɔ | 960px na di pikchɔ | 1140px na di pikchɔ |
.container-md |
100% na di . | 100% na di . | 720px na di pikchɔ | 960px na di pikchɔ | 1140px na di pikchɔ |
.container-lg |
100% na di . | 100% na di . | 100% na di . | 960px na di pikchɔ | 1140px na di pikchɔ |
.container-xl |
100% na di . | 100% na di . | 100% na di . | 100% na di . | 1140px na di pikchɔ |
.container-fluid |
100% na di . | 100% na di . | 100% na di . | 100% na di . | 100% na di . |
Ɔl-in-wan
Wi difɔlt .container
klas na kɔntena we de ansa, we gɛt fiks-wid, we min se i de max-width
chenj na ɛni brek pɔynt.
Wata-wata
Yuz .container-fluid
fɔ wan ful wit kɔntena, we de span di wan ol wit fɔ di viupɔt.
Fɔ ansa
Respɔnsiv kɔntena dɛn na nyu tin dɛn na Bootstrap v4.4. Dɛn de alaw yu fɔ spɛsifa wan klas we 100% waid te di spɛsifikɛd brekpɔynt rich, afta dat wi de aplay max-width
s fɔ ɛni wan pan di ay brekpɔynt dɛn. Fɔ ɛgzampul, .container-sm
na 100% waid fɔ stat te di sm
brek pɔynt rich, usay i go skel ɔp wit md
, lg
, ɛn xl
.
Brekpoint dɛn we de ansa
Bikɔs dɛn dɔn mek Bootstrap fɔ bi mobayl fɔs, wi de yuz wan anful midia kwɛstyɔn dɛn fɔ mek sɛnsful brekpɔynt dɛn fɔ wi layout ɛn intafays dɛn. Dɛn brekpɔynt ya mɔs bies pan di minimum viupɔt wit ɛn dɛn de alaw wi fɔ skel ɔp ɛlimɛnt dɛn as di viupɔt de chenj.
Bootstrap de yuz di fɔs midia kwɛstyɔn rɛnj dɛn—ɔ brekpɔynt dɛn—insay wi sɔs Sass fayl dɛn fɔ wi layout, grid sistem, ɛn kɔmpɔnɛnt dɛn.
Sins wi rayt wi sɔs CSS na Sass, ɔl wi midia kwɛstyɔn dɛn de via Sass mixins:
Wan wan tɛm wi kin yuz midia kwɛstyɔn dɛn we kin go na di ɔda say (di skrin saiz we dɛn gi ɔ di smɔl wan ):
Notis se bikɔs brawza dɛn nɔ de sɔpɔt rɛnj kɔntɛks kwɛstyɔn dɛn naw , wi de wok rawnd di limiteshɔn dɛn fɔ min-
ɛn max-
prɛfiks ɛn viupɔt dɛn wit frakshɔn wid (we kin apin ɔnda sɔm kɔndishɔn dɛn na ay-dpi divays dɛn, fɔ ɛgzampul) bay we wi de yuz valyu dɛn wit ay prɛsishɔn fɔ dɛn kɔmpiashɔn dɛn ya .
Wans bak, dɛn midia kwɛstyɔn ya de bak bay Sass mixins:
I gɛt bak midia kwɛstyɔn ɛn miksin fɔ tɔch wan singl sɛgmɛnt pan skrin saiz dɛn we de yuz di minim ɛn maksimal brekpɔynt wit.
Dɛn midia kwɛstyɔn ya de bak bay Sass mixins:
Semweso, midia kwɛstyɔn dɛn kin span bɔku bɔku brekpɔynt wit dɛn:
Di Sass mixin fɔ target di sem skrin saiz rɛnj go bi:
Z-indeks
Bɔku Bootstrap kɔmpɔnɛnt dɛn de yuz z-index
, di CSS prɔpati we de ɛp fɔ kɔntrol layout bay we i de gi wan tɔd aks fɔ arenj kɔntinyu. Wi de yuz wan difɔlt z-indeks skel na Bootstrap we dɛn dɔn mek fɔ layt nevigishɔn, tultips ɛn popovers, modals, ɛn mɔ fayn fayn wan.
Dɛn ay valyu ya kin stat pan wan arbitri nɔmba, ay ɛn spɛshal inof fɔ ideally avɔyd kɔnflikt. Wi nid wan standad sɛt fɔ dɛn wan ya akɔdin to wi layt kɔmpɔnɛnt dɛn—tultips, popovers, navbars, dropdowns, modals—so wi kin rili kɔnsistɛnt insay di bihayvya dɛn. No rizin nɔ de fɔ mek wi nɔ bin fɔ dɔn yuz 100
+ ɔ 500
+.
Wi nɔ de ɛnkɔrej fɔ kɔstɔmayt dɛn wan wan valyu dɛn ya; if yu chenj wan, yu go mɔs nid fɔ chenj dɛn ɔl.
Fɔ handel ɔvalap bɔda dɛn insay kɔmpɔnɛnt dɛn (ɛgz., bɔtin ɛn input dɛn na input grup dɛn), wi de yuz lɔw singl dijit z-index
valyu dɛn fɔ 1
, 2
, ɛn 3
fɔ difɔlt, hova, ɛn aktiv stet dɛn. Na hover/focus/active, wi de bring wan patikyula elemɛnt to di fɔs wan wit wan ay z-index
valyu fɔ sho dɛn bɔda oba di brɔda ɛn sista ɛlimɛnt dɛn.