Recall & Review
beginner
What does the Tailwind CSS
container utility do?The
container utility creates a responsive max-width box. It is typically used with mx-auto to center your content horizontally and px-4 classes for side padding.Click to reveal answer
beginner
How do you center a container horizontally in Tailwind CSS?
By applying
mx-auto to the container element, which sets margin-left: auto and margin-right: auto.Click to reveal answer
intermediate
Which Tailwind CSS classes help control the max-width of a container at different screen sizes?
The
container utility automatically sets max-widths at responsive breakpoints: sm (640px), md (768px), lg (1024px), xl (1280px), and 2xl (1536px).Click to reveal answer
beginner
How can you add horizontal padding inside a Tailwind container?
You add padding using classes like
px-4 or px-6 to add horizontal padding inside the container for spacing.Click to reveal answer
intermediate
Why is using the
container utility better than fixed pixel widths for centering content?Because
container is responsive and adapts to screen sizes, it keeps content centered and readable on all devices without manual width adjustments.Click to reveal answer
What does the Tailwind
container utility primarily do?✗ Incorrect
The
container utility sets responsive max-widths and is centered horizontally using mx-auto.Which class would you add to a container to add horizontal padding?
✗ Incorrect
px-4 adds horizontal padding (left and right).How does Tailwind make containers responsive?
✗ Incorrect
Tailwind uses responsive prefixes to adjust container max-widths at different screen sizes.
What CSS property is used to center a Tailwind container horizontally?
✗ Incorrect
Horizontal centering is done with automatic left and right margins.
Why should you use the container utility instead of fixed widths?
✗ Incorrect
The container utility adapts to screen sizes, making layouts responsive.
Explain how Tailwind's container utility helps center content and make layouts responsive.
Think about how containers behave on small and large screens.
You got /4 concepts.
Describe how you would add horizontal padding inside a Tailwind container and why it is useful.
Padding keeps content from touching edges.
You got /3 concepts.