0
0
Tailwindmarkup~20 mins

Order and self-alignment in Tailwind - Practice Problems & Coding Challenges

Choose your learning style9 modes available
Challenge - 5 Problems
🎖️
Order and Self-Alignment Master
Get all challenges correct to earn this badge!
Test your skills under time pressure!
layout
intermediate
2:00remaining
What is the visual order of items with Tailwind's order classes?
Given this HTML with Tailwind CSS classes, what is the order in which the items appear visually?

<div class="flex">
  <div class="order-3">Item 1</div>
  <div class="order-1">Item 2</div>
  <div class="order-2">Item 3</div>
</div>
Tailwind
<div class="flex">
  <div class="order-3">Item 1</div>
  <div class="order-1">Item 2</div>
  <div class="order-2">Item 3</div>
</div>
AItem 3, Item 2, Item 1
BItem 1, Item 2, Item 3
CItem 3, Item 1, Item 2
DItem 2, Item 3, Item 1
Attempts:
2 left
💡 Hint
Remember, lower order values appear first in flex containers.
selector
intermediate
1:30remaining
Which Tailwind class aligns a single flex item to the end of the cross axis?
You have a flex container with vertical direction. Which Tailwind class should you add to a single item to align it to the bottom (end) of the container?
Aself-end
Bitems-end
Cjustify-end
Dcontent-end
Attempts:
2 left
💡 Hint
Think about aligning one item, not the whole container.
🧠 Conceptual
advanced
2:00remaining
What happens if multiple flex items have the same order value in Tailwind?
Consider a flex container where two items have the same order value using Tailwind classes. How does the browser decide their visual order?
AThe browser randomly orders them
BThey appear in the order they are in the HTML source
CThe item with the larger width appears first
DThey overlap visually
Attempts:
2 left
💡 Hint
Think about the default behavior when order values tie.
rendering
advanced
2:30remaining
What is the vertical position of the green box with 'self-center' in this flex container?
Given this code:

<div class="flex flex-col h-40 border border-gray-400">
  <div class="bg-red-400 h-10">Red</div>
  <div class="bg-green-400 h-10 self-center">Green</div>
  <div class="bg-blue-400 h-10">Blue</div>
</div>

Where will the green box appear vertically inside the container?
Tailwind
<div class="flex flex-col h-40 border border-gray-400">
  <div class="bg-red-400 h-10">Red</div>
  <div class="bg-green-400 h-10 self-center">Green</div>
  <div class="bg-blue-400 h-10">Blue</div>
</div>
ACentered horizontally but stacked vertically in normal order
BAligned at the bottom of the container
CCentered vertically between Red and Blue boxes
DStretched to fill the container height
Attempts:
2 left
💡 Hint
Remember flex-col means main axis is vertical; self-center aligns on cross axis.
accessibility
expert
3:00remaining
How does changing order with Tailwind affect keyboard navigation and screen readers?
If you use Tailwind's order utilities to visually reorder flex items, what is the impact on keyboard navigation and screen readers?
AScreen readers ignore the content of reordered items
BKeyboard navigation and screen readers follow the visual order set by CSS order
CKeyboard and screen readers follow the HTML source order, ignoring visual order
DKeyboard navigation breaks, but screen readers follow visual order
Attempts:
2 left
💡 Hint
Think about how assistive technologies read the page structure.