Utilities rau layout
Txhawm rau kom nrawm nrawm nrawm thiab ua haujlwm zoo, Bootstrap suav nrog ntau ntau chav kawm siv hluav taws xob rau kev qhia, zais, sib dhos, thiab sib nrug cov ntsiab lus.
Hloovdisplay
Siv peb cov khoom siv tso saib rau kev teb toggling qhov tseem ceeb ntawm cov display
cuab yeej. Muab nws nrog peb cov kab sib chaws, cov ntsiab lus, lossis cov khoom siv los qhia lossis zais lawv hla cov chaw saib tshwj xeeb.
Flexbox xaiv
Bootstrap 4 yog tsim nrog flexbox, tab sis tsis yog txhua lub ntsiab lus display
tau hloov mus rau display: flex
qhov no yuav ntxiv ntau yam tsis tsim nyog overrides thiab poob nthav hloov pauv tus cwj pwm tseem ceeb hauv browser. Feem ntau ntawm peb cov khoom yog tsim nrog flexbox enabled.
Yog tias koj xav tau ntxiv display: flex
rau ib lub caij, ua li ntawd nrog .d-flex
lossis ib qho ntawm cov kev hloov pauv (xws li, .d-sm-flex
). Koj yuav xav tau cov chav kawm no lossis display
tus nqi kom tso cai rau kev siv peb cov khoom siv flexbox ntxiv rau qhov loj me, sib dhos, sib nrug, thiab lwm yam.
Margin thiab padding
Siv cov khoom siv hluav margin
taws padding
xob sib txawv los tswj cov khoom thiab cov khoom sib txawv li cas thiab qhov loj me. Bootstrap 4 suav nrog tsib-theem nplai rau qhov sib nrug, raws li tus 1rem
nqi $spacer
sib txawv. Xaiv qhov tseem ceeb rau txhua qhov chaw saib (xws li, .mr-3
rau margin-right: 1rem
), lossis xaiv cov kev hloov pauv hloov mus rau lub hom phiaj tshwj xeeb cov chaw saib (xws li, .mr-md-3
pib margin-right: 1rem
ntawm qhov md
tawg).
Togglevisibility
Thaum toggling display
tsis xav tau, koj tuaj yeem toggle lub visibility
ntsiab lus nrog peb cov khoom siv pom kev pom . Cov ntsiab lus pom tsis pom yuav tseem cuam tshuam rau qhov layout ntawm nplooj ntawv, tab sis pom pom zais los ntawm cov neeg tuaj saib.