0
0
Tailwindmarkup~20 mins

Padding utilities in Tailwind - Practice Problems & Coding Challenges

Choose your learning style9 modes available
Challenge - 5 Problems
🎖️
Padding Pro
Get all challenges correct to earn this badge!
Test your skills under time pressure!
selector
intermediate
1:30remaining
Which Tailwind class adds padding of 1rem on all sides?
Select the Tailwind CSS class that applies exactly 1rem padding on all four sides of an element.
Ap-4
Bp-1
Cp-2
Dp-6
Attempts:
2 left
💡 Hint
Tailwind padding classes use a scale where p-4 equals 1rem by default.
🧠 Conceptual
intermediate
1:30remaining
What does the class px-3 do in Tailwind CSS?
Choose the correct description of the effect of the Tailwind class px-3.
AAdds margin of 0.75rem on left and right only
BAdds vertical padding of 0.75rem (top and bottom) only
CAdds padding of 0.75rem on all sides
DAdds horizontal padding of 0.75rem (left and right) only
Attempts:
2 left
💡 Hint
The 'x' in px-3 stands for horizontal axis.
rendering
advanced
2:00remaining
What is the visual effect of applying pt-8 pb-4 to a box?
Given a box with these Tailwind classes: pt-8 pb-4, what padding does it have?
Tailwind
<div class="pt-8 pb-4 bg-blue-200">Content</div>
ATop padding 1rem, bottom padding 2rem
BTop padding 2rem, bottom padding 1rem
CTop and bottom padding both 2rem
DTop and bottom padding both 1rem
Attempts:
2 left
💡 Hint
Remember Tailwind spacing scale: 8 means 2rem, 4 means 1rem.
accessibility
advanced
1:30remaining
Why is consistent padding important for accessibility?
Choose the best reason why consistent padding helps accessibility in web design.
AIt automatically adds ARIA labels to elements
BIt reduces page load time by minimizing CSS size
CIt improves keyboard navigation by making clickable areas easier to target
DIt changes font sizes to be more readable
Attempts:
2 left
💡 Hint
Think about how padding affects clickable or tappable areas.
📝 Syntax
expert
1:30remaining
What error occurs if you write p-x-4 in Tailwind CSS?
Identify the problem with the class p-x-4 and what happens when you use it.
Tailwind
<div class="p-x-4">Example</div>
ANo padding applied because the class is invalid and ignored
BPadding applied only on the x-axis with 1rem
CSyntax error in CSS causing the page to break
DPadding applied on all sides with 1rem
Attempts:
2 left
💡 Hint
Tailwind uses specific order for padding classes like p, px, py.