Recall & Review
beginner
What does the Tailwind CSS class
p-4 do?It adds padding of 1rem (16px) on all four sides of an element. The number 4 corresponds to Tailwind's spacing scale.
Click to reveal answer
beginner
How do you add padding only to the left side of an element in Tailwind CSS?
Use the class
pl-{size}, for example pl-6 adds padding-left of 1.5rem.Click to reveal answer
beginner
What is the difference between
px-3 and py-3 in Tailwind CSS?px-3 adds horizontal padding (left and right), while py-3 adds vertical padding (top and bottom).Click to reveal answer
beginner
How can you remove all padding from an element using Tailwind CSS?
Use the class
p-0 to set padding on all sides to zero.Click to reveal answer
beginner
What unit does Tailwind CSS use for padding sizes like
p-4?Tailwind uses rem units based on a default root font size of 16px. For example,
p-4 equals 1rem or 16px.Click to reveal answer
Which Tailwind class adds padding only to the top of an element?
✗ Incorrect
pt-5 adds padding-top. pl-5 is padding-left, p-5 is padding all sides, pb-5 is padding-bottom.What does
py-2 do in Tailwind CSS?✗ Incorrect
py-2 adds vertical padding: top and bottom.If you want no padding on an element, which class should you use?
✗ Incorrect
p-0 sets padding to zero on all sides.Which class adds horizontal padding of 0.75rem (12px) in Tailwind?
✗ Incorrect
px-3 adds padding-left and padding-right of 0.75rem.What unit does Tailwind use for padding sizes like
p-6?✗ Incorrect
Tailwind uses rem units based on the root font size (usually 16px).
Explain how to add different padding sizes to each side of an element using Tailwind CSS.
Think about how you control padding side by side.
You got /4 concepts.
Describe how Tailwind's padding scale relates to actual spacing in the browser.
Consider how Tailwind converts class numbers to real sizes.
You got /4 concepts.