0
0
Tailwindmarkup~20 mins

First Tailwind component (Hello World) - Practice Problems & Coding Challenges

Choose your learning style9 modes available
Challenge - 5 Problems
🎖️
Tailwind Mastery Badge
Get all challenges correct to earn this badge!
Test your skills under time pressure!
rendering
intermediate
2: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>
AA right-aligned blue bold text saying 'Hello World'
BA left-aligned red italic text saying 'Hello World'
CA centered green normal text saying 'Hello World'
DA centered blue bold text saying 'Hello World'
Attempts:
2 left
💡 Hint
Check the Tailwind classes for text alignment, color, and font style.
selector
intermediate
1: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?
Atext-center
Bitems-center
Cmx-auto
Djustify-center
Attempts:
2 left
💡 Hint
Think about margin and block elements.
layout
advanced
2: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>
AAlways stacked vertically regardless of screen size
BStacked vertically on small screens, side by side horizontally on medium and larger screens
CAlways side by side horizontally regardless of screen size
DStacked horizontally on small screens, vertically on medium and larger screens
Attempts:
2 left
💡 Hint
Look at the responsive prefixes like 'md:' and the flex direction classes.
accessibility
advanced
2: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>
Afocus:ring-4 focus:ring-blue-300
Bhover:bg-blue-700
Cactive:bg-blue-900
Dfocus:outline-none
Attempts:
2 left
💡 Hint
Focus styles should make the element stand out when tabbed to.
🧠 Conceptual
expert
3: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?
AIt allows building designs quickly by composing small reusable classes without writing custom CSS
BIt automatically generates CSS animations without any code
CIt requires no knowledge of HTML to style components
DIt replaces JavaScript functionality with CSS-only solutions
Attempts:
2 left
💡 Hint
Think about how Tailwind classes are used to style elements.