0
0
Tailwindmarkup~20 mins

Align items (cross axis) in Tailwind - Practice Problems & Coding Challenges

Choose your learning style9 modes available
Challenge - 5 Problems
🎖️
Cross Axis Alignment Master
Get all challenges correct to earn this badge!
Test your skills under time pressure!
selector
intermediate
2:00remaining
Which Tailwind class aligns items to the center on the cross axis?
You have a flex container. Which Tailwind CSS class will center the items vertically (cross axis)?
Tailwind
<div class="flex h-32 border border-gray-400">
  <div class="bg-blue-500 text-white p-2">Item 1</div>
  <div class="bg-green-500 text-white p-2">Item 2</div>
</div>
Aitems-center
Bjustify-center
Ccontent-center
Dself-center
Attempts:
2 left
💡 Hint
Think about the cross axis alignment in flexbox, not the main axis.
rendering
intermediate
2:00remaining
What is the visual result of this Tailwind code?
Given this HTML, how are the items aligned vertically inside the flex container?
Tailwind
<div class="flex items-start h-24 border border-gray-400">
  <div class="bg-red-500 text-white p-2">A</div>
  <div class="bg-yellow-500 text-black p-2">B</div>
  <div class="bg-green-500 text-white p-2">C</div>
</div>
AAll items aligned at the center vertically
BAll items aligned at the top of the container
CAll items aligned at the bottom of the container
DItems stretched to fill container height
Attempts:
2 left
💡 Hint
The class items-start controls cross axis alignment.
🧠 Conceptual
advanced
2:00remaining
Which Tailwind class aligns a single flex item to the center on the cross axis?
You want only one item inside a flex container to be vertically centered, while others remain at the top. Which class should you add to that item?
Tailwind
<div class="flex items-start h-24 border border-gray-400">
  <div class="bg-purple-500 text-white p-2">Item 1</div>
  <div class="bg-pink-500 text-white p-2">Item 2</div>
  <div class="bg-indigo-500 text-white p-2">Item 3</div>
</div>
Aself-center
Bcontent-center
Cjustify-center
Ditems-center
Attempts:
2 left
💡 Hint
This class affects only one item, not the whole container.
layout
advanced
2:00remaining
How does items-stretch affect flex items?
In a flex container with fixed height, what does the Tailwind class items-stretch do to the items?
Tailwind
<div class="flex items-stretch h-32 border border-gray-400">
  <div class="bg-teal-500 text-white p-2">Box 1</div>
  <div class="bg-orange-500 text-white p-2">Box 2</div>
</div>
AItems center vertically but keep original height
BItems align at the bottom of the container
CItems keep their original height and align at the top
DItems stretch to fill the container height
Attempts:
2 left
💡 Hint
Stretch means fill the available space on the cross axis.
accessibility
expert
3:00remaining
Which alignment choice improves keyboard navigation and screen reader clarity in a flex container?
You have a horizontal navigation bar with flex items. Which cross axis alignment helps maintain consistent focus order and clear reading for screen readers?
Tailwind
<nav class="flex items-center h-12 bg-gray-100">
  <a href="#home" class="px-4">Home</a>
  <a href="#about" class="px-4">About</a>
  <a href="#contact" class="px-4">Contact</a>
</nav>
Aitems-end to align links at the bottom
Bitems-start to align links at the top
Citems-center to keep all links vertically aligned
Ditems-stretch to fill the container height
Attempts:
2 left
💡 Hint
Consistent vertical alignment helps users track focus visually and logically.