Dodome dometsotso
Bootstrap lɔ shorthand responsive margin kple padding utility class vovovowo ɖe eme be woatrɔ asi le element aɖe ƒe dzedzeme ŋu.
Ale si wòwɔa dɔe
De ŋuɖoɖo-xɔlɔ̃wɔwɔ margin
alo padding
asixɔxɔwo asi na element alo eƒe axawo ƒe akpa sue aɖe kple nuŋɔŋlɔ kpui ƒe klasswo. Kpekpeɖeŋu na nɔnɔme ɖekaɖekawo, nɔnɔmewo katã, kple nɔnɔme siwo le tsitrenu kple esiwo le tsia dzi la le eme. Wotua klasswo tso Sass ƒe anyigbatata si woɖo ɖi si tso .25rem
vaseɖe 3rem
.
Nuŋɔŋlɔ
Dometsotso ƒe dɔwɔnu siwo ku ɖe breakpoints katã ŋu, tso xs
vaseɖe xl
, mekpɔ breakpoint ƒe kpukpui aɖeke le wo me o. Esia le alea elabena wowɔa klass mawo ŋudɔ tso min-width: 0
kple dzi, eye to esia me la, womeblaa wo kple nyadzɔdzɔgblɔmɔnuwo ƒe biabia o. Gake breakpoint susɔeawo dometɔ aɖewoe nye breakpoint kpukpui aɖe.
Wozãa nɔnɔme {property}{sides}-{size}
si nye , , , kple , xs
tsɔ naa ŋkɔ klassawo .{property}{sides}-{breakpoint}-{size}
sm
md
lg
xl
Afisiwo nunɔamesiwo nye:
m
- na klass siwo ɖomargin
p
- na klass siwo ɖopadding
Afisi akpawo nye:
t
- na klass siwo ɖomargin-top
alopadding-top
b
- na klass siwo ɖomargin-bottom
alopadding-bottom
l
- na klass siwo ɖomargin-left
alopadding-left
r
- na klass siwo ɖomargin-right
alopadding-right
x
- na klass siwo ɖoa evea siaa*-left
kple*-right
y
- na klass siwo ɖoa evea siaa*-top
kple*-bottom
- blank - na klass siwo ɖo a
margin
alopadding
ɖe element la ƒe akpa 4 katã dzi
Afisi lolome nye:
0
- na klass siwo ɖeamargin
alopadding
to eɖoɖo ɖe0
1
- (le gɔmedzedzea me) na klass siwo ɖomargin
alopadding
to$spacer * .25
2
- (le gɔmedzedzea me) na klass siwo ɖomargin
alopadding
to$spacer * .5
3
- (le gɔmedzedzea me) na klass siwo ɖomargin
alopadding
to$spacer
4
- (le gɔmedzedzea me) na klass siwo ɖomargin
alopadding
to$spacer * 1.5
5
- (le gɔmedzedzea me) na klass siwo ɖomargin
alopadding
to$spacer * 3
auto
- na klass siwo ɖoamargin
be auto
(Àteŋu atsɔ lolome bubuwo akpe ɖe eŋu to nyawo tsɔtsɔ kpe ɖe $spacers
Sass ƒe anyigbatata ƒe tɔtrɔ ŋu me.)
Kpɔɖeŋuwo
Klass siawo ƒe kpɔɖeŋu aɖewo siwo tsi tre ɖi na lae nye esi:
.mt-0 {
margin-top: 0 !important;
}
.ml-1 {
margin-left: ($spacer * .25) !important;
}
.px-2 {
padding-left: ($spacer * .5) !important;
padding-right: ($spacer * .5) !important;
}
.p-3 {
padding: $spacer !important;
}
Titina si le tsia dzi
Tsɔ kpe ɖe eŋu la, Bootstrap hã de .mx-auto
klass aɖe si me woatsɔ aɖo titina le tsia dzi le fixed-width block level content—si fia be, content that has display: block
and a width
set—to ɖoɖowɔwɔ ɖe horizontal margins ɖe auto
.
<div class="mx-auto" style="width: 200px;">
Centered element
</div>
Negative ƒe vovototodedeameme
Le CSS me la, margin
nɔnɔmewo ateŋu azã asixɔxɔ manyomanyowo ( padding
mateŋu o). Tso 4.2 dzi la, míetsɔ margin negative utilities kpe ɖe xexlẽdzesi blibo ƒe lolome ɖesiaɖe si menye zero o si woŋlɔ ɖe etame ŋu (le kpɔɖeŋu me, 1
, 2
, 3
, 4
, 5
). Dɔwɔnu siawo sɔ nyuie na asitɔtrɔ le grid column gutters ŋu le breakpoints katã me.
Nyagɔmeɖegbalẽa sɔ kple default, positive margin utilities kloe, gake wotsɔe kpe ɖe eŋu n
do ŋgɔ na lolome si wobia. Kpɔɖeŋu ƒe klass aɖe si to vovo na .mt-1
:
.mt-n1 {
margin-top: -0.25rem !important;
}
Kpɔɖeŋu aɖe si nye be nàtrɔ asi le Bootstrap grid ŋu le medium ( md
) breakpoint kple esi wu nenema lae nye esi. Míedzi .col
padding la ɖe edzi kple .px-md-5
eye emegbe míetsi tre ɖe ema ŋu kple .mx-md-n5
le dzila la dzi .row
.
<div class="row mx-md-n5">
<div class="col px-md-5"><div class="p-3 border bg-light">Custom column padding</div></div>
<div class="col px-md-5"><div class="p-3 border bg-light">Custom column padding</div></div>
</div>