0
0
Bootsrapmarkup~10 mins

Spacing utilities (margin, padding) in Bootsrap - Interactive Code Practice

Choose your learning style9 modes available
Practice - 5 Tasks
Answer the questions below
1fill in blank
easy

Complete the code to add a margin of 3 units on all sides of the div.

Bootsrap
<div class="[1]">Content</div>
Drag options to blanks, or click blank then click option'
Am-3
Bp-3
Cmt-3
Dmx-3
Attempts:
3 left
💡 Hint
Common Mistakes
Using padding class p-3 instead of margin.
Using only top margin mt-3 which affects one side.
Using horizontal margin mx-3 which affects only left and right.
2fill in blank
medium

Complete the code to add padding of 4 units only on the left side of the paragraph.

Bootsrap
<p class="[1]">This is a paragraph.</p>
Drag options to blanks, or click blank then click option'
Aps-4
Bpr-4
Cpb-4
Dpt-4
Attempts:
3 left
💡 Hint
Common Mistakes
Using right padding pr-4 instead of left.
Using top or bottom padding classes.
Confusing margin and padding classes.
3fill in blank
hard

Fix the error in the code to add horizontal margin of 2 units to the button.

Bootsrap
<button class="btn btn-primary [1]">Click me</button>
Drag options to blanks, or click blank then click option'
Apy-2
Bmx-2
Cm-2
Dmy-2
Attempts:
3 left
💡 Hint
Common Mistakes
Using vertical margin my-2 instead of horizontal.
Using padding classes py-2 instead of margin.
Using all sides margin m-2 which affects more than horizontal.
4fill in blank
hard

Fill both blanks to add padding of 1 unit on top and margin of 5 units on bottom of the div.

Bootsrap
<div class="[1] [2]">Box</div>
Drag options to blanks, or click blank then click option'
Apt-1
Bmb-5
Cmt-5
Dpb-1
Attempts:
3 left
💡 Hint
Common Mistakes
Mixing padding and margin sides incorrectly.
Using wrong spacing numbers.
Using bottom padding instead of margin.
5fill in blank
hard

Fill all three blanks to create a div with margin top 4, padding right 3, and margin left 2.

Bootsrap
<div class="[1] [2] [3]">Content</div>
Drag options to blanks, or click blank then click option'
Amt-4
Bpr-3
Cml-2
Dpb-2
Attempts:
3 left
💡 Hint
Common Mistakes
Confusing padding and margin sides.
Using wrong spacing numbers.
Using bottom padding instead of right padding.