0
0
Bootsrapmarkup~5 mins

Spacing utilities (margin, padding) in Bootsrap - Cheat Sheet & Quick Revision

Choose your learning style9 modes available
Recall & Review
beginner
What does the Bootstrap class m-3 do?
It adds margin on all sides of an element with a size of 3 (which equals 1rem by default).
Click to reveal answer
beginner
How do you add padding only to the left side of an element in Bootstrap?
Use the class ps-* where * is the size number (0 to 5). For example, ps-2 adds padding-left with size 2.
Click to reveal answer
beginner
What is the difference between m-0 and p-0 in Bootstrap?
m-0 removes all margin from the element, while p-0 removes all padding.
Click to reveal answer
intermediate
Explain what mx-auto does in Bootstrap.
It sets the left and right margins to auto, centering the element horizontally within its container.
Click to reveal answer
intermediate
How do you apply different spacing on different screen sizes using Bootstrap spacing utilities?
Use responsive classes like m-sm-2 or p-lg-4 to apply margin or padding starting from the specified breakpoint (small, large, etc.).
Click to reveal answer
Which Bootstrap class adds padding on all sides with size 4?
Ap-4
Bm-4
Cpx-4
Dpy-4
What does the class mt-0 do?
AAdds top padding size 0
BRemoves top margin
CAdds top margin size 0.5
DRemoves all margin
How do you center a block element horizontally using Bootstrap spacing utilities?
AAdd <code>my-auto</code>
BAdd <code>m-auto</code>
CAdd <code>p-auto</code>
DAdd <code>mx-auto</code>
Which class adds margin only on the bottom with size 3?
Aml-3
Bmt-3
Cmb-3
Dmr-3
How do you add padding-left size 2 only on medium and larger screens?
Aps-md-2
Bpl-md-2
Cps-2-md
Dp-md-l-2
Describe how Bootstrap spacing utilities help control margin and padding on elements.
Think about how you add space around or inside boxes in a webpage.
You got /4 concepts.
    Explain how to center an element horizontally using Bootstrap spacing utilities.
    Remember how auto margins can center blocks in CSS.
    You got /3 concepts.