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 tau tsim nrog flexbox, tab sis tsis yog txhua lub ntsiab lus display
tau hloov pauv display: flex
vim qhov no yuav ntxiv ntau yam tsis tsim nyog overrides thiab poob nthav hloov pauv tus cwj pwm tseem ceeb ntawm qhov 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 suav nrog rau 6-theem nplai rau qhov chaw siv hluav taws xob, raws li tus 1rem
nqi $spacer
hloov pauv hloov pauv. Xaiv qhov tseem ceeb rau txhua qhov chaw saib (piv txwv li, .me-3
rau margin-right: 1rem
hauv LTR), lossis xaiv cov kev hloov pauv hloov mus rau lub hom phiaj tshwj xeeb saib (piv txwv li, .me-md-3
rau margin-right: 1rem
- hauv LTR - pib 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.