Kpɔɖeŋunyagbɔgblɔ
Kpeɖeŋutɔ kple tiatia siwo nàwɔ atsɔ aɖo wò Bootstrap dɔa ɖe ɖoɖo nu, siwo dometɔ aɖewoe nye nugoewo babla, grid ɖoɖo sesẽ aɖe, nyadzɔdzɔgblɔmɔ̃ ƒe nu si te ŋu trɔna bɔbɔe, kple dɔwɔnu ƒe klass siwo ɖoa nya ŋu.
Nugoewo me
Nugoewo nye ɖoɖowɔɖi ƒe akpa vevitɔ kekeake le Bootstrap me eye wohiã ne wole míaƒe grid ɖoɖo si woɖo ɖi la zãm . Wozãa nugoewo tsɔ léa nusiwo le wo me ɖe te, tsɔa wo ɖoa wo me, eye (ɣeaɖewoɣi) wotsɔa wo ɖoa titina. Togbɔ be woateŋu atsɔ nugoewo aɖo atɔ me hã la, ɖoɖo akpa gãtɔ mehiã be woatsɔ nugoe aɖo atɔ me o.
Bootstrap va kple nugoe vovovo etɔ̃:
.container
, si ɖoa amax-width
le breakpoint ɖesiaɖe si ɖoa nya ŋu.container-fluid
, si nyewidth: 100%
gbagbãƒe ɖesiaɖe.container-{breakpoint}
, si nyewidth: 100%
vaseɖe esime woɖo gbagbãƒe
Tabla si le ete la ɖe alesi nugoe ɖesiaɖe ƒe max-width
tsɔtsɔ sɔ kple gbãtɔa .container
kple .container-fluid
le gbagbãƒe ɖesiaɖe me fia.
Kpɔ wo le dɔwɔwɔ me eye nàtsɔ wo asɔ kple wo nɔewo le míaƒe Grid ƒe kpɔɖeŋua me .
Susu sue aɖe kpee <576px |
Sue ≥576px |
Medium ≥768px ƒe didime |
Gã ≥992px |
Gã wu ≥1200px |
|
---|---|---|---|---|---|
.container |
100% ƒe . | 540px ƒe didime | 720px ƒe didime | 960px ƒe didime | 1140px ƒe didime |
.container-sm |
100% ƒe . | 540px ƒe didime | 720px ƒe didime | 960px ƒe didime | 1140px ƒe didime |
.container-md |
100% ƒe . | 100% ƒe . | 720px ƒe didime | 960px ƒe didime | 1140px ƒe didime |
.container-lg |
100% ƒe . | 100% ƒe . | 100% ƒe . | 960px ƒe didime | 1140px ƒe didime |
.container-xl |
100% ƒe . | 100% ƒe . | 100% ƒe . | 100% ƒe . | 1140px ƒe didime |
.container-fluid |
100% ƒe . | 100% ƒe . | 100% ƒe . | 100% ƒe . | 100% ƒe . |
Nusianu le ɖeka me
Míaƒe .container
klass si woɖo ɖi la nye nugoe si ɖoa nya ŋu, si ƒe kekeme woɖo ɖi, si fia be eƒe max-width
tɔtrɔwo le gbagbãƒe ɖesiaɖe.
<div class="container">
<!-- Content here -->
</div>
Tsi nu
Zãe .container-fluid
na nugoe si ƒe kekeme bliboa, si keke ɖe enu le nukpɔƒea ƒe kekeme bliboa me.
<div class="container-fluid">
...
</div>
Nyaŋuɖoɖo
Nugoe siwo ɖoa nya ŋu la nye nu yeyewo le Bootstrap v4.4 me. Woɖea mɔ na wò be nàgblɔ klass si keke 100% vaseɖe esime nàɖo gbagbãƒe si woɖo la gbɔ, le ema megbe la, míewɔa max-width
s ŋudɔ na gbagbãƒe kɔkɔtɔwo dometɔ ɖesiaɖe. Le kpɔɖeŋu me, .container-sm
keke 100% be woadze egɔme vaseɖe esime woaɖo sm
gbagbãƒea gbɔ, afisi wòadzi ɖe edzi kple md
, lg
, kple xl
.
<div class="container-sm">100% wide until small breakpoint</div>
<div class="container-md">100% wide until medium breakpoint</div>
<div class="container-lg">100% wide until large breakpoint</div>
<div class="container-xl">100% wide until extra large breakpoint</div>
Gbeɖeka siwo ɖoa nya ŋu
Esi wònye be wowɔ Bootstrap be wòanye asitelefon gbã ta la, míezãa nyadzɔdzɔgblɔmɔnuwo ƒe nyabiase ʋɛ aɖewo tsɔ wɔa vovototo siwo me susu le na míaƒe ɖoɖowo kple ŋgɔdonyawo. Wotu gbagbãƒe siawo ƒe akpa gãtɔ ɖe nukpɔkpɔ ƒe kekeme suetɔ kekeake dzi eye woɖea mɔ na mí be míadzi nuawo ɖe edzi ne nukpɔkpɔa le tɔtrɔm.
Bootstrap koŋ zãa media biabia ƒe didime siwo gbɔna—alo breakpoints—le míaƒe dzɔtsoƒe Sass faɛlwo me na míaƒe ɖoɖo, grid ɖoɖo, kple akpawo.
// Extra small devices (portrait phones, less than 576px)
// No media query for `xs` since this is the default in Bootstrap
// Small devices (landscape phones, 576px and up)
@media (min-width: 576px) { ... }
// Medium devices (tablets, 768px and up)
@media (min-width: 768px) { ... }
// Large devices (desktops, 992px and up)
@media (min-width: 992px) { ... }
// Extra large devices (large desktops, 1200px and up)
@media (min-width: 1200px) { ... }
Esi míeŋlɔa míaƒe dzɔtsoƒe CSS ɖe Sass me ta la, míaƒe nyadzɔdzɔgblɔmɔnuwo katã li to Sass mixins dzi:
// No media query necessary for xs breakpoint as it's effectively `@media (min-width: 0) { ... }`
@include media-breakpoint-up(sm) { ... }
@include media-breakpoint-up(md) { ... }
@include media-breakpoint-up(lg) { ... }
@include media-breakpoint-up(xl) { ... }
// Example: Hide starting at `min-width: 0`, and then show at the `sm` breakpoint
.custom-class {
display: none;
}
@include media-breakpoint-up(sm) {
.custom-class {
display: block;
}
}
Míezãa nyadzɔdzɔgblɔmɔnuwo ƒe nyabiase siwo yia mɔ bubu dzi ɣeaɖewoɣi (screen ƒe lolome si wona alo esi le sue wu ):
// Extra small devices (portrait phones, less than 576px)
@media (max-width: 575.98px) { ... }
// Small devices (landscape phones, less than 768px)
@media (max-width: 767.98px) { ... }
// Medium devices (tablets, less than 992px)
@media (max-width: 991.98px) { ... }
// Large devices (desktops, less than 1200px)
@media (max-width: 1199.98px) { ... }
// Extra large devices (large desktops)
// No media query since the extra-large breakpoint has no upper bound on its width
min-
kple max-
prefixes kple viewports kple fractional widths (si ate ŋu adzɔ le nɔnɔme aɖewo me le high-dpi devices dzi, le kpɔɖeŋu me) to asixɔxɔ siwo le pɛpɛpɛ wu zazã me na tsɔtsɔ sɔ kple wo nɔewo siawo .
Le afisia hã la, nyadzɔdzɔgblɔmɔnuwo ƒe nyabiase siawo hã li to Sass mixins dzi:
@include media-breakpoint-down(xs) { ... }
@include media-breakpoint-down(sm) { ... }
@include media-breakpoint-down(md) { ... }
@include media-breakpoint-down(lg) { ... }
// No media query necessary for xl breakpoint as it has no upper bound on its width
// Example: Style from medium breakpoint and down
@include media-breakpoint-down(md) {
.custom-class {
display: block;
}
}
Media biabia kple mixins hã li hena taɖodzinu ɖoɖo ɖe screen ƒe lolome ƒe akpa ɖeka ŋu to breakpoint ƒe kekeme suetɔ kple gãtɔ zazã me.
// Extra small devices (portrait phones, less than 576px)
@media (max-width: 575.98px) { ... }
// Small devices (landscape phones, 576px and up)
@media (min-width: 576px) and (max-width: 767.98px) { ... }
// Medium devices (tablets, 768px and up)
@media (min-width: 768px) and (max-width: 991.98px) { ... }
// Large devices (desktops, 992px and up)
@media (min-width: 992px) and (max-width: 1199.98px) { ... }
// Extra large devices (large desktops, 1200px and up)
@media (min-width: 1200px) { ... }
Media biabia siawo hã li to Sass mixins dzi:
@include media-breakpoint-only(xs) { ... }
@include media-breakpoint-only(sm) { ... }
@include media-breakpoint-only(md) { ... }
@include media-breakpoint-only(lg) { ... }
@include media-breakpoint-only(xl) { ... }
Nenema ke nyadzɔdzɔgblɔmɔnuwo ƒe nyabiasewo ateŋu akeke ta ɖe breakpoint ƒe kekeme geɖe ŋu:
// Example
// Apply styles starting from medium devices and up to extra large devices
@media (min-width: 768px) and (max-width: 1199.98px) { ... }
Sass mixin si woatsɔ aɖo taɖodzinu na screen ƒe lolome ƒe didime ɖeka ma ke anye:
@include media-breakpoint-between(md, xl) { ... }
Z-nufiamefianu
Bootstrap ƒe akpa geɖewo zãa z-index
, CSS ƒe nɔnɔme si kpena ɖe ɖoɖowɔɖi dzi kpɔkpɔ ŋu to axis etɔ̃lia nana be wòaɖo nyatakakawo ɖe ɖoɖo nu me. Míezãa z-index dzidzenu si woɖo ɖi le Bootstrap me si wowɔ be wòatsɔ aɖo mɔfiamewo, dɔwɔnuwo kple popovers, modals, kple bubuwo la nyuie.
Asixɔxɔ siawo siwo kɔ wu la dzea egɔme tso xexlẽme si woɖo ɖi dzi, si kɔkɔ eye wòle tẽ ale gbegbe be le mɔ nyuitɔ nu la, woaƒo asa na masɔmasɔwo. Míehiã esiawo ƒe ɖoɖo si sɔ le míaƒe akpa siwo le ƒuƒoƒo me—dɔwɔnu ƒe aɖaŋuɖoɖowo, popovers, navbars, dropdowns, modals—ale be míate ŋu awɔ ɖeka le nuwɔnaawo me le mɔ si sɔ nu. Susu aɖeke meli si tae míate ŋu azã 100
+ alo 500
+ hafi o.
Míedea dzi ƒo be woatrɔ asi le dzidzenu ɖekaɖeka siawo ŋu o; ne ètrɔ ɖeka la, anɔ eme be ahiã be nàtrɔ wo katã.
$zindex-dropdown: 1000 !default;
$zindex-sticky: 1020 !default;
$zindex-fixed: 1030 !default;
$zindex-modal-backdrop: 1040 !default;
$zindex-modal: 1050 !default;
$zindex-popover: 1060 !default;
$zindex-tooltip: 1070 !default;
Be míakpɔ liƒo siwo ƒo xlã wo nɔewo le akpawo me gbɔ (le kpɔɖeŋu me, abɔtawo kple nyawo tsɔtsɔ de eme le nyawo tsɔtsɔ de eme ƒe ƒuƒoƒowo me), míezãa xexlẽdzesi ɖeka ƒe z-index
asixɔxɔ siwo le bɔbɔe siwo nye 1
, 2
, kple 3
na nɔnɔme siwo woɖo ɖi, hover, kple nɔnɔme siwo le dɔ wɔm. Le hover/focus/active dzi la, míetsɔa nu tɔxɛ aɖe vaa ŋgɔgbe kple z-index
asixɔxɔ si kɔkɔ wu be míaɖe woƒe liƒo afia ɖe nɔviawo ƒe akpaawo dzi.