Challenge - 5 Problems
Tailwind Mastery Badge
Get all challenges correct to earn this badge!
Test your skills under time pressure!
❓ rendering
intermediate2:00remaining
What will this Tailwind component display?
Look at this simple Tailwind CSS component. What text will appear on the screen when you open it in a browser?
Tailwind
<div class="text-center text-blue-600 font-bold text-lg">Hello World</div>Attempts:
2 left
💡 Hint
Check the Tailwind classes for text alignment, color, and font style.
✗ Incorrect
The classes 'text-center' centers the text, 'text-blue-600' colors it blue, 'font-bold' makes it bold, and 'text-lg' sets a large font size.
❓ selector
intermediate1:30remaining
Which Tailwind class centers content horizontally?
You want to center a block element horizontally inside its container using Tailwind CSS. Which class should you use?
Attempts:
2 left
💡 Hint
Think about margin and block elements.
✗ Incorrect
'mx-auto' sets left and right margins to auto, centering block elements horizontally. 'text-center' centers inline text, 'items-center' and 'justify-center' are for flexbox alignment.
❓ layout
advanced2:30remaining
How does this Tailwind flex container arrange items?
Given this code, how will the three boxes be arranged on a wide screen?
Tailwind
<div class="flex flex-col md:flex-row gap-4"> <div class="bg-red-400 p-4">Box 1</div> <div class="bg-green-400 p-4">Box 2</div> <div class="bg-blue-400 p-4">Box 3</div> </div>
Attempts:
2 left
💡 Hint
Look at the responsive prefixes like 'md:' and the flex direction classes.
✗ Incorrect
'flex-col' stacks items vertically by default. 'md:flex-row' changes direction to horizontal on medium screens and up. 'gap-4' adds space between boxes.
❓ accessibility
advanced2:00remaining
Which Tailwind class improves keyboard focus visibility?
You want to make sure a button is clearly visible when focused using keyboard navigation. Which Tailwind class helps with this?
Tailwind
<button class="bg-blue-500 text-white px-4 py-2 rounded">Click me</button>Attempts:
2 left
💡 Hint
Focus styles should make the element stand out when tabbed to.
✗ Incorrect
'focus:ring-4 focus:ring-blue-300' adds a visible ring around the button on keyboard focus, improving accessibility. 'focus:outline-none' removes focus outline, which is bad for accessibility.
🧠 Conceptual
expert3:00remaining
What is the main benefit of using Tailwind's utility-first approach?
Why do many developers prefer Tailwind CSS's utility-first classes over writing custom CSS styles?
Attempts:
2 left
💡 Hint
Think about how Tailwind classes are used to style elements.
✗ Incorrect
Tailwind's utility-first approach provides many small classes that can be combined to build designs fast, reducing the need to write custom CSS. It does not generate animations automatically or replace JavaScript, and HTML knowledge is still needed.